Merge pull request #881 from devsaurus/ucg-getstrwidth

fix parameter access for ucg.getStrWidth()
This commit is contained in:
Terry Ellison 2015-12-28 15:27:27 +00:00
commit 59c36cf526
1 changed files with 2 additions and 2 deletions

View File

@ -402,7 +402,7 @@ static int lucg_getHeight( lua_State *L )
return 1; return 1;
} }
// Lua: width = ucg.getStrWidth( self ) // Lua: width = ucg.getStrWidth( self, string )
static int lucg_getStrWidth( lua_State *L ) static int lucg_getStrWidth( lua_State *L )
{ {
lucg_userdata_t *lud; lucg_userdata_t *lud;
@ -410,7 +410,7 @@ static int lucg_getStrWidth( lua_State *L )
if ((lud = get_lud( L )) == NULL) if ((lud = get_lud( L )) == NULL)
return 0; return 0;
const char *s = luaL_checkstring( L, (1+3) + 1 ); const char *s = luaL_checkstring( L, 2 );
if (s == NULL) if (s == NULL)
return 0; return 0;