X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2FmysqlConn.c;h=d2430f0889d0ec772dd1d15f236a655e0b266e22;hb=989cb8324ec8fe9caba511d89051552638dbc776;hp=802c5918ea53b80de775b5fcccbb32c602ccb96a;hpb=95b073d5242d1bf995d84e3511dbc43328ebff75;p=NeonServV5.git diff --git a/src/mysqlConn.c b/src/mysqlConn.c index 802c591..d2430f0 100644 --- a/src/mysqlConn.c +++ b/src/mysqlConn.c @@ -1,5 +1,5 @@ /* mysqlConn.c - NeonServ v5.3 - * Copyright (C) 2011 Philipp Kreil (pk910) + * Copyright (C) 2011-2012 Philipp Kreil (pk910) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -203,6 +203,25 @@ void printf_mysql_query(const char *text, ...) { } } +void printf_long_mysql_query(int len, const char *text, ...) { + va_list arg_list; + char queryBuf[len]; + int pos; + queryBuf[0] = '\0'; + va_start(arg_list, text); + pos = vsnprintf(queryBuf, len - 2, text, arg_list); + va_end(arg_list); + if (pos < 0 || pos > (len - 2)) pos = len - 2; + queryBuf[pos] = '\0'; + printf("MySQL: %s\n", queryBuf); + if(mysql_query(mysql_conn, queryBuf)) { + check_mysql(); + if(mysql_query(mysql_conn, queryBuf)) { + show_mysql_error(); + } + } +} + char* escape_string(const char *str) { struct escaped_string *escapedstr = malloc(sizeof(*escapedstr)); if (!escapedstr) {