]> git.sesse.net Git - vlc/commitdiff
lua: fix an argument validation error
authorLudovic Fauvet <etix@l0cal.com>
Tue, 19 Apr 2011 10:07:37 +0000 (12:07 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 19 Apr 2011 12:23:53 +0000 (14:23 +0200)
According to the documentation, strings.from_charset expects two
arguments, not three.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/lua/libs/strings.c

index 7920025c6220968f208ff0ed42b3b6a26f7ea9a3..d9aeaa5b71f32ae61e583f3d2fb955e94965d549 100644 (file)
@@ -125,7 +125,7 @@ static int vlclua_convert_xml_special_chars( lua_State *L )
 
 static int vlclua_from_charset( lua_State *L )
 {
-    if( lua_gettop( L ) < 3 ) return vlclua_error( L );
+    if( lua_gettop( L ) < 2 ) return vlclua_error( L );
 
     size_t i_in_bytes;
     const char *psz_input = luaL_checklstring( L, 2, &i_in_bytes );