Diff

util-src/encodings.c @ 6665:e923d7cb8430

Merge
author Matthew Wild <mwild1@gmail.com>
date Wed, 06 May 2015 19:21:29 +0100
parent 6643:127b9f0c6135
child 6789:6b180e77c97a
line wrap: on
line diff
--- a/util-src/encodings.c	Wed May 06 19:21:18 2015 +0100
+++ b/util-src/encodings.c	Wed May 06 19:21:29 2015 +0100
@@ -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);