aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-10-02 16:44:14 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-10-02 16:44:14 +0500
commit27766b1c030702960601094c113c0494cfac7676 (patch)
tree2b88b23e4d0bfd0350b454add4705b13c09f37e8
parent4ebc9fa7ddc26fce006a74404e5d586ef797b32d (diff)
downloadprosody-27766b1c030702960601094c113c0494cfac7676.tar.gz
prosody-27766b1c030702960601094c113c0494cfac7676.zip
util.encodings: Fixed: Last change was not ANSI C compatible.
-rw-r--r--util-src/encodings.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/util-src/encodings.c b/util-src/encodings.c
index 65d7d501..6c6e53ea 100644
--- a/util-src/encodings.c
+++ b/util-src/encodings.c
@@ -125,9 +125,14 @@ static const luaL_Reg Reg_base64[] =
static int stringprep_prep(lua_State *L, const Stringprep_profile *profile)
{
size_t len;
- const char *s = luaL_checklstring(L, 1, &len);
+ const char *s;
char string[1024];
int ret;
+ if(!lua_isstring(L, 1)) {
+ lua_pushnil(L);
+ return 1;
+ }
+ s = lua_tolstring(L, 1, &len);
if (len >= 1024) {
lua_pushnil(L);
return 1; // TODO return error message