Changeset

6643:127b9f0c6135

util.encodings: Move declarations to top of function [pedantic]
author Kim Alvefur <zash@zash.se>
date Sat, 02 May 2015 14:52:51 +0200 (2015-05-02)
parents 6642:113d321976b6
children 6646:9795b8cf14f1
files util-src/encodings.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);