diff options
author | Mark Pulford <mark@kyne.com.au> | 2011-04-25 15:07:19 +0930 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2011-04-25 15:07:19 +0930 |
commit | 3662f8b4e6f4335bd72e14f86e7237d74c595d02 (patch) | |
tree | cec396f2af6b5b5758105c161c9b5cca76184802 | |
parent | 85f2231b381a232686a39e4962b3d5e3cad61161 (diff) | |
download | lua-cjson-3662f8b4e6f4335bd72e14f86e7237d74c595d02.tar.gz lua-cjson-3662f8b4e6f4335bd72e14f86e7237d74c595d02.tar.bz2 lua-cjson-3662f8b4e6f4335bd72e14f86e7237d74c595d02.zip |
Tidy Lua arg count verification
-rw-r--r-- | lua_json.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -261,7 +261,7 @@ int lua_c_json_encode(lua_State *l) | |||
261 | char *json; | 261 | char *json; |
262 | int len; | 262 | int len; |
263 | 263 | ||
264 | lua_ensure_arg_count(l, "lua_c_json_encode", 1); | 264 | lua_verify_arg_count(l, 1); |
265 | 265 | ||
266 | json = lua_json_encode(l, &len); | 266 | json = lua_json_encode(l, &len); |
267 | 267 | ||
@@ -655,7 +655,7 @@ int lua_c_json_decode(lua_State *l) | |||
655 | { | 655 | { |
656 | const char *json; | 656 | const char *json; |
657 | 657 | ||
658 | lua_ensure_arg_count(l, "json_c_json_decode", 1); | 658 | lua_verify_arg_count(l, 1); |
659 | luaL_argcheck(l, lua_islightuserdata(l, 1), 1, | 659 | luaL_argcheck(l, lua_islightuserdata(l, 1), 1, |
660 | "missing lightuserdata"); | 660 | "missing lightuserdata"); |
661 | 661 | ||
@@ -671,7 +671,7 @@ static int lua_api_json_decode(lua_State *l) | |||
671 | { | 671 | { |
672 | const char *json; | 672 | const char *json; |
673 | 673 | ||
674 | lua_ensure_arg_count(l, "json.decode", 1); | 674 | lua_verify_arg_count(l, 1); |
675 | json = luaL_checkstring(l, 1); | 675 | json = luaL_checkstring(l, 1); |
676 | 676 | ||
677 | lua_json_decode(l, json); | 677 | lua_json_decode(l, json); |