From 20629386ca2bbf2e224355f5d7b7bbc4e91af6d4 Mon Sep 17 00:00:00 2001 From: devsaurus Date: Mon, 28 Dec 2015 15:22:09 +0100 Subject: [PATCH] fix parameter access for ucg.getStrWidth() --- app/modules/ucg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/modules/ucg.c b/app/modules/ucg.c index 9c0506d2..f5089e26 100644 --- a/app/modules/ucg.c +++ b/app/modules/ucg.c @@ -402,7 +402,7 @@ static int lucg_getHeight( lua_State *L ) return 1; } -// Lua: width = ucg.getStrWidth( self ) +// Lua: width = ucg.getStrWidth( self, string ) static int lucg_getStrWidth( lua_State *L ) { lucg_userdata_t *lud; @@ -410,7 +410,7 @@ static int lucg_getStrWidth( lua_State *L ) if ((lud = get_lud( L )) == NULL) return 0; - const char *s = luaL_checkstring( L, (1+3) + 1 ); + const char *s = luaL_checkstring( L, 2 ); if (s == NULL) return 0;