Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit30f35ef

Browse files
author
Thomas G. Lockhart
committed
Test for and handle NULL arguments to mylog() print statements.
Include definition for _IN_ADDR_T if INADDR_NONE is not defined.
1 parentf47bd80 commit30f35ef

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

‎src/interfaces/odbc/convert.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ struct tm *tim;
120120
st.d=tim->tm_mday;
121121
st.y=tim->tm_year+1900;
122122

123-
mylog("copy_and_convert: field_type = %d, fctype = %d, value = '%s', cbValueMax=%d\n",field_type,fCType,value,cbValueMax);
123+
mylog("copy_and_convert: field_type = %d, fctype = %d, value = '%s', cbValueMax=%d\n",field_type,fCType,(value==NULL)?"<NULL>":value,cbValueMax);
124124

125125
if ( !value) {
126126
/* handle a null just by returning SQL_NULL_DATA in pcbValue, */

‎src/interfaces/odbc/qresult.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ QR_fetch_tuples(QResultClass *self, ConnectionClass *conn, char *cursor)
186186
if (conn!=NULL) {
187187
self->conn=conn;
188188

189-
mylog("QR_fetch_tuples: cursor = '%s', self->cursor=%u\n",cursor,self->cursor);
189+
mylog("QR_fetch_tuples: cursor = '%s', self->cursor=%u\n",
190+
(cursor==NULL)?"":cursor,self->cursor);
190191

191192
if (self->cursor)
192193
free(self->cursor);

‎src/interfaces/odbc/results.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ mylog("SQLFetch: stmt = %u, stmt->result= %u\n", stmt, stmt->result);
855855
value=QR_get_value_backend_row(res,stmt->currTuple,lf);
856856
}
857857

858-
mylog("value = '%s'\n",value);
858+
mylog("value = '%s'\n",(value==NULL)?"<NULL>":value);
859859

860860
retval=copy_and_convert_field_bindinfo(stmt,type,value,lf);
861861

‎src/interfaces/odbc/socket.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
#include<arpa/inet.h>
2424
#defineclosesocket(xxx) close(xxx)
2525
#defineSOCKETFD int
26+
#ifndefINADDR_NONE
27+
#ifndef_IN_ADDR_T
28+
#define_IN_ADDR_T
29+
typedefunsignedintin_addr_t;
30+
#endif
31+
#defineINADDR_NONE ((in_addr_t)-1)
32+
#endif
2633
#else
2734
#include<winsock.h>
2835
#defineSOCKETFD SOCKET

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp