# HG changeset patch # User Kim Alvefur # Date 1430571171 -7200 # Node ID 127b9f0c61351ea200f28fa0f384d9e0eb668978 # Parent 113d321976b65989e540b397b0e991031b8c75d6 util.encodings: Move declarations to top of function [pedantic] diff -r 113d321976b6 -r 127b9f0c6135 util-src/encodings.c --- a/util-src/encodings.c Sat May 02 14:41:56 2015 +0200 +++ b/util-src/encodings.c Sat May 02 14:52:51 2015 +0200 @@ -476,14 +476,15 @@ 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);