# HG changeset patch # User Matthew Wild # Date 1254247637 -3600 # Node ID e52dbae3c05d8204afda08b23b4f55241db91a82 # Parent 07d8c9184a5ffee7294c8fdc8f80c5485536ce3c# Parent a4a8fe2a560c0bdce269e51e45c5d33d5adc7306 Merge with 0.5 diff -r 07d8c9184a5f -r e52dbae3c05d util-src/encodings.c --- a/util-src/encodings.c Tue Sep 29 14:22:43 2009 +0100 +++ b/util-src/encodings.c Tue Sep 29 19:07:17 2009 +0100 @@ -124,8 +124,12 @@ 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) {