]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix format
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 15 Aug 2012 17:15:09 +0000 (12:15 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 15 Aug 2012 17:15:09 +0000 (12:15 -0500)
src/switch_odbc.c

index a0204de243b7d0f320c10df6c14863f027f5b898..bba4b4cbe60947906145e00c09ef6342ab3f3f78 100644 (file)
@@ -336,7 +336,7 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_connect(switch_odbc_hand
        int result;
        SQLINTEGER err;
        int16_t mlen;
-       unsigned char msg[200], stat[10];
+       unsigned char msg[200] = "", stat[10] = "";
        SQLSMALLINT valueLength = 0;
        int i = 0;
 
@@ -365,8 +365,8 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_connect(switch_odbc_hand
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s\n", err_str);
                        free(err_str);
                } else {
-                       SQLGetDiagRec(SQL_HANDLE_DBC, handle->con, 1, stat, &err, msg, 100, &mlen);
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error SQLConnect=%d errno=%d %s\n", result, (int) err, msg);
+                       SQLGetDiagRec(SQL_HANDLE_DBC, handle->con, 1, stat, &err, msg, sizeof(msg), &mlen);
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error SQLConnect=%d errno=%d [%s]\n", result, (int) err, msg);
                }
 
                /* Deallocate handles again, more chanses to succeed when reconnecting */