commit 9e507ecf20e70a8331d22f3a3ccc962469e0d123
parent 10c4e391a1118697ced0d8936fe1130738fac01d
Author: Claudio Alessi <smoppy@gmail.com>
Date: Tue, 10 May 2016 20:05:01 +0200
Declare sqlen at the top of the function.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/myadm.c b/myadm.c
@@ -434,10 +434,10 @@ int
mysql_exec(const char *sqlstr, ...) {
va_list ap;
char sql[MAXQUERYLEN];
- int r;
+ int r, sqlen;
va_start(ap, sqlstr);
- int sqlen = vsnprintf(sql, sizeof sql, sqlstr, ap);
+ sqlen = vsnprintf(sql, sizeof sql, sqlstr, ap);
va_end(ap);
r = mysql_real_query(mysql, sql, sqlen);
return (r ? -1 : mysql_field_count(mysql));