aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-05-02 14:52:51 +0200
committerKim Alvefur <zash@zash.se>2015-05-02 14:52:51 +0200
commit7c5e79fe04f322c76f154c7d18d377693dddf1b7 (patch)
tree9be77c10d3a1383b60062d05ded2d4fbcc23c706
parentad9d518ec1b82a9585e5b77604d50014acd58e26 (diff)
downloadprosody-7c5e79fe04f322c76f154c7d18d377693dddf1b7.tar.gz
prosody-7c5e79fe04f322c76f154c7d18d377693dddf1b7.zip
util.encodings: Move declarations to top of function [pedantic]
-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);