From ab942065240450c3d2824a8a307f8a1b9bcf9516 Mon Sep 17 00:00:00 2001
From: shennetsind <ind@henn.et>
Date: Sat, 11 Jan 2014 15:32:29 -0200
Subject: Fixed Bug 7960

http://hercules.ws/board/tracker/issue-7960-scriptc-warnings/
Also applied a temporary adjustment due to ERS_OPT_CLEAN not being consistent (decent fix will follow up, haru and i are working on it) -- thanks to kyeme for pointing it out!

Signed-off-by: shennetsind <ind@henn.et>
---
 src/common/socket.c | 2 +-
 src/map/script.c    | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

(limited to 'src')

diff --git a/src/common/socket.c b/src/common/socket.c
index 1ffa15708..95333cdce 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -1407,7 +1407,7 @@ void socket_init(void)
 	timer->add_interval(timer->gettick()+1000, connect_check_clear, 0, 0, 5*60*1000);
 #endif
 
-	ShowInfo("Server supports up to '"CL_WHITE"%lld"CL_RESET"' concurrent connections.\n", rlim_cur);
+	ShowInfo("Server supports up to '"CL_WHITE"%"PRId64""CL_RESET"' concurrent connections.\n", rlim_cur);
 	
 	/* Hercules Plugin Manager */
 	HPM->share(session,"session");
diff --git a/src/map/script.c b/src/map/script.c
index 0ce768128..7b640a237 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2751,6 +2751,8 @@ void script_array_update(struct DBMap **src, int64 num, bool empty) {
 	} else if ( !empty ) {/* we only move to create if not empty */
 		sa = ers_alloc(script->array_ers, struct script_array);
 		sa->id = id;
+		sa->members = NULL;
+		sa->size = 0;
 		script->array_add_member(sa,index);
 		idb_put(*src, id, sa);
 	}
@@ -2917,7 +2919,7 @@ const char* conv_str(struct script_state* st, struct script_data* data)
 	else if( data_isint(data) )
 	{// int -> string
 		CREATE(p, char, ITEM_NAME_LENGTH);
-		snprintf(p, ITEM_NAME_LENGTH, "%lld", data->u.num);
+		snprintf(p, ITEM_NAME_LENGTH, "%"PRId64"", data->u.num);
 		p[ITEM_NAME_LENGTH-1] = '\0';
 		data->type = C_STR;
 		data->u.str = p;
@@ -3619,7 +3621,7 @@ int run_func(struct script_state *st)
 		if (!(script->str_data[func].func(st))) //Report error
 			script->reportsrc(st);
 	} else {
-		ShowError("script:run_func: '%s' (id=%lld type=%s) has no C function. please report this!!!\n", script->get_str(func), func, script->op2name(script->str_data[func].type));
+		ShowError("script:run_func: '%s' (id=%"PRId64" type=%s) has no C function. please report this!!!\n", script->get_str(func), func, script->op2name(script->str_data[func].type));
 		script->reportsrc(st);
 		st->state = END;
 	}
-- 
cgit v1.2.3-70-g09d2