71 lines
2.8 KiB
Diff
71 lines
2.8 KiB
Diff
Back-patch assorted fixes in isql.c from 2.3.0; notably, remove duplicate
|
|
variable declarations that caused bug #628909, and fix some potential
|
|
64-bit portability problems.
|
|
|
|
|
|
diff -Naur unixODBC-2.2.14.orig/exe/isql.c unixODBC-2.2.14/exe/isql.c
|
|
--- unixODBC-2.2.14.orig/exe/isql.c 2008-06-16 07:03:43.000000000 -0400
|
|
+++ unixODBC-2.2.14/exe/isql.c 2010-08-31 14:30:26.912367399 -0400
|
|
@@ -243,9 +243,6 @@
|
|
}
|
|
else
|
|
{
|
|
- char *line;
|
|
- int malloced;
|
|
-
|
|
line = fgets( line_buffer, line_buffer_size, stdin );
|
|
if ( !line ) /* EOF - ctrl D */
|
|
{
|
|
@@ -300,7 +297,7 @@
|
|
exec_now = 1;
|
|
len --;
|
|
}
|
|
- else if ( len == 2 && memcmp( line, "go", 2 ) == 0 )
|
|
+ else if ( len == 3 && memcmp( line, "go", 2 ) == 0 )
|
|
{
|
|
exec_now = 1;
|
|
dont_copy = 1;
|
|
@@ -867,7 +864,7 @@
|
|
}
|
|
}
|
|
|
|
- if ( SQLPrepare( hStmt, (SQLCHAR*)szSQL, SQL_NTS ) != SQL_SUCCESS )
|
|
+ if ( SQLPrepare( hStmt, (SQLCHAR*)szSQL, strlen( szSQL )) != SQL_SUCCESS )
|
|
{
|
|
if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt );
|
|
fprintf( stderr, "[ISQL]ERROR: Could not SQLPrepare\n" );
|
|
@@ -1364,10 +1361,10 @@
|
|
|
|
/* HDR */
|
|
sret = sprintf( (char*)szColumn, "| %-*.*s",
|
|
- nOptimalDisplayWidth, nOptimalDisplayWidth, szColumnName );
|
|
+ (int)nOptimalDisplayWidth, (int)nOptimalDisplayWidth, szColumnName );
|
|
if (sret < 0)
|
|
sprintf((char *)szColumn, "| %-*.*s",
|
|
- nOptimalDisplayWidth, nOptimalDisplayWidth, "**ERROR**");
|
|
+ (int)nOptimalDisplayWidth, (int)nOptimalDisplayWidth, "**ERROR**");
|
|
strcat( (char*)szHdrLine,(char*) szColumn );
|
|
}
|
|
strcat((char*) szSepLine, "+\n" );
|
|
@@ -1413,9 +1410,9 @@
|
|
if ( nReturn == SQL_SUCCESS && nIndicator != SQL_NULL_DATA )
|
|
{
|
|
sret = sprintf( (char*)szColumn, "| %-*.*s",
|
|
- nOptimalDisplayWidth, nOptimalDisplayWidth, szColumnValue );
|
|
+ (int)nOptimalDisplayWidth, (int)nOptimalDisplayWidth, szColumnValue );
|
|
if (sret < 0) sprintf( (char*)szColumn, "| %-*.*s",
|
|
- nOptimalDisplayWidth, nOptimalDisplayWidth, "**ERROR**" );
|
|
+ (int)nOptimalDisplayWidth, (int)nOptimalDisplayWidth, "**ERROR**" );
|
|
|
|
}
|
|
else if ( nReturn == SQL_ERROR )
|
|
@@ -1424,7 +1421,7 @@
|
|
}
|
|
else
|
|
{
|
|
- sprintf( (char*)szColumn, "| %-*s", nOptimalDisplayWidth, "" );
|
|
+ sprintf( (char*)szColumn, "| %-*s", (int)nOptimalDisplayWidth, "" );
|
|
}
|
|
fputs( (char*)szColumn, stdout );
|
|
} /* for columns */
|