diff options
author | Byron Nikolaidis <byronn@insightdist.com> | 1998-07-22 23:47:48 +0000 |
---|---|---|
committer | Byron Nikolaidis <byronn@insightdist.com> | 1998-07-22 23:47:48 +0000 |
commit | 6e66468f3a160878111578a93be2852635eb4f4d (patch) | |
tree | 2a0bbd3b9f18b68446a8d82e4e9b9fcb80ed3885 /src/interfaces/odbc/misc.c | |
parent | 2a677424122012d2eaa4c6d1113fc6b9b121720b (diff) |
Version 06-30-0248
Diffstat (limited to 'src/interfaces/odbc/misc.c')
-rw-r--r-- | src/interfaces/odbc/misc.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/interfaces/odbc/misc.c b/src/interfaces/odbc/misc.c index 382508d6730..68bb7ae63b0 100644 --- a/src/interfaces/odbc/misc.c +++ b/src/interfaces/odbc/misc.c @@ -37,7 +37,7 @@ static FILE *LOGFP = 0; fmt = va_arg(args, char *); if (! LOGFP) { - LOGFP = fopen("c:\\mylog.log", "w"); + LOGFP = fopen(MYLOGFILE, "w"); setbuf(LOGFP, NULL); } @@ -64,7 +64,7 @@ static FILE *LOGFP = 0; fmt = va_arg(args, char *); if (! LOGFP) { - LOGFP = fopen("c:\\psqlodbc.log", "w"); + LOGFP = fopen(QLOGFILE, "w"); setbuf(LOGFP, NULL); } @@ -77,12 +77,24 @@ static FILE *LOGFP = 0; #endif /* Undefine these because windows.h will redefine and cause a warning */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#ifndef UNIX #undef va_start #undef va_end +#endif - +#ifdef HAVE_IODBC +#include "iodbc.h" +#include "isql.h" +#else #include <windows.h> #include <sql.h> +#endif + /* returns STRCPY_FAIL, STRCPY_TRUNCATED, or #bytes copied (not including null term) */ int @@ -155,7 +167,7 @@ make_string(char *s, int len, char *buf) int length; char *str; - if(s && (len > 0 || len == SQL_NTS)) { + if(s && (len > 0 || (len == SQL_NTS && strlen(s) > 0))) { length = (len > 0) ? len : strlen(s); if (buf) { |