aboutsummaryrefslogtreecommitdiffstats
path: root/util-src/encodings.c
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-05-06 19:21:29 +0100
committerMatthew Wild <mwild1@gmail.com>2015-05-06 19:21:29 +0100
commitec83b2aa91ab9142ad6e7f4d26b0f6d20853e747 (patch)
treeac1899833b30b87ea97439f061e9b892bd188367 /util-src/encodings.c
parent150799952b2bb969b2cea28c48f52b9ccad13b2b (diff)
parentd67ec1537ba3d0e41615f43c0afe13828ecc002e (diff)
downloadprosody-ec83b2aa91ab9142ad6e7f4d26b0f6d20853e747.tar.gz
prosody-ec83b2aa91ab9142ad6e7f4d26b0f6d20853e747.zip
Merge
Diffstat (limited to 'util-src/encodings.c')
-rw-r--r--util-src/encodings.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/util-src/encodings.c b/util-src/encodings.c
index 2eaad2c8..c00b2267 100644
--- a/util-src/encodings.c
+++ b/util-src/encodings.c
@@ -476,14 +476,15 @@ static int Lidna_to_unicode(lua_State* L) { /** idna.to_unicode(s) */
static int Lidna_to_ascii(lua_State* L) { /** idna.to_ascii(s) */
size_t len;
const char* s = check_utf8(L, 1, &len);
+ char* output = NULL;
+ int ret;
if(s == NULL || len != strlen(s)) {
lua_pushnil(L);
return 1; /* TODO return error message */
}
- char* output = NULL;
- int ret = idna_to_ascii_8z(s, &output, IDNA_USE_STD3_ASCII_RULES);
+ ret = idna_to_ascii_8z(s, &output, IDNA_USE_STD3_ASCII_RULES);
if(ret == IDNA_SUCCESS) {
lua_pushstring(L, output);