[vlc-commits] lua: fix an argument validation error

Ludovic Fauvet git at videolan.org
Tue Apr 19 14:24:13 CEST 2011


vlc | branch: master | Ludovic Fauvet <etix at l0cal.com> | Tue Apr 19 12:07:37 2011 +0200| [2f918cf7343386cbf782b66db6c5790e8103feef] | committer: Jean-Baptiste Kempf

lua: fix an argument validation error

According to the documentation, strings.from_charset expects two
arguments, not three.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2f918cf7343386cbf782b66db6c5790e8103feef
---

 modules/lua/libs/strings.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/lua/libs/strings.c b/modules/lua/libs/strings.c
index 7920025..d9aeaa5 100644
--- a/modules/lua/libs/strings.c
+++ b/modules/lua/libs/strings.c
@@ -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 );



More information about the vlc-commits mailing list