Initialize column size to 0 to deal with a potential UnixODBC bug on 64-bit systems.

(closes issue #18295)
 Reported by: pruiz


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@310140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Tilghman Lesher 16 years ago
parent 744b5c4bbb
commit eafdcbacd4

@ -2473,6 +2473,7 @@ static int retrieve_file(char *dir, int msgnum)
fprintf(f, "[message]\n");
for (x=0;x<colcount;x++) {
rowdata[0] = '\0';
colsize = 0;
collen = sizeof(coltitle);
res = SQLDescribeCol(stmt, x + 1, (unsigned char *)coltitle, sizeof(coltitle), &collen,
&datatype, &colsize, &decimaldigits, &nullable);

@ -223,6 +223,7 @@ static struct ast_variable *realtime_odbc(const char *database, const char *tabl
}
for (x = 0; x < colcount; x++) {
rowdata[0] = '\0';
colsize = 0;
collen = sizeof(coltitle);
res = SQLDescribeCol(stmt, x + 1, (unsigned char *)coltitle, sizeof(coltitle), &collen,
&datatype, &colsize, &decimaldigits, &nullable);
@ -377,6 +378,7 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char *
}
for (x=0;x<colcount;x++) {
rowdata[0] = '\0';
colsize = 0;
collen = sizeof(coltitle);
res = SQLDescribeCol(stmt, x + 1, (unsigned char *)coltitle, sizeof(coltitle), &collen,
&datatype, &colsize, &decimaldigits, &nullable);

Loading…
Cancel
Save