b25888b419
www: http://www.wxwidgets.org/ from Andrew Dalgleish < openbsd at ajd dot net dot au > many thanks for much persistence!
32 lines
852 B
Plaintext
32 lines
852 B
Plaintext
$OpenBSD: patch-src_iodbc_herr_c,v 1.1.1.1 2004/07/16 21:01:35 todd Exp $
|
|
--- src/iodbc/herr.c.orig Wed Jun 2 01:31:41 1999
|
|
+++ src/iodbc/herr.c Wed Apr 30 10:03:24 2003
|
|
@@ -291,15 +291,13 @@ SQLError (
|
|
|
|
if (ststr == NULL)
|
|
{
|
|
- len = 0;
|
|
+ szSqlstate[0] = 0;
|
|
}
|
|
else
|
|
{
|
|
- len = (int) STRLEN (ststr);
|
|
+ strlcpy (szSqlstate, ststr, 6);
|
|
}
|
|
|
|
- STRNCPY (szSqlstate, ststr, len);
|
|
- szSqlstate[len] = 0;
|
|
/* buffer size of szSqlstate is not checked. Applications
|
|
* suppose provide enough ( not less than 6 bytes ) buffer
|
|
* or NULL for it.
|
|
@@ -347,8 +345,7 @@ SQLError (
|
|
/* and not posts error for itself */
|
|
}
|
|
|
|
- STRNCPY ((char *) szErrorMsg, msgbuf, len);
|
|
- szErrorMsg[len] = 0;
|
|
+ strlcpy ((char *) szErrorMsg, msgbuf, len);
|
|
|
|
if (pcbErrorMsg != NULL)
|
|
{
|