diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-09-29 19:07:17 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-09-29 19:07:17 +0100 |
commit | e22d1deb6b31bdf6795dbb5c0b810bed3c9a3663 (patch) | |
tree | 6b864f174c399bcf19866cd9a8be61904e878f3f /util-src | |
parent | 32fa99e2b7c12397ba8ca1e97f1a8c48aededd1c (diff) | |
parent | e094c8b08b002896c440c3b55785bcf119007c91 (diff) | |
download | prosody-e22d1deb6b31bdf6795dbb5c0b810bed3c9a3663.tar.gz prosody-e22d1deb6b31bdf6795dbb5c0b810bed3c9a3663.zip |
Merge with 0.5
Diffstat (limited to 'util-src')
-rw-r--r-- | util-src/encodings.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/util-src/encodings.c b/util-src/encodings.c index 65d7d501..bee4365c 100644 --- a/util-src/encodings.c +++ b/util-src/encodings.c @@ -124,8 +124,12 @@ static const luaL_Reg Reg_base64[] = static int stringprep_prep(lua_State *L, const Stringprep_profile *profile) { + if(!lua_isstring(L, 1)) { + lua_pushnil(L); + return 1; + } size_t len; - const char *s = luaL_checklstring(L, 1, &len); + const char *s = lua_tolstring(L, 1, &len); char string[1024]; int ret; if (len >= 1024) { |