]> granicus.if.org Git - php/commitdiff
- More strncpy() -> strlcpy() changes. Am I getting bored yet? :)
authorAndi Gutmans <andi@php.net>
Wed, 2 May 2001 23:20:04 +0000 (23:20 +0000)
committerAndi Gutmans <andi@php.net>
Wed, 2 May 2001 23:20:04 +0000 (23:20 +0000)
ext/odbc/php_odbc.c

index 15220393d4b1cf4341fcf8cdc919acf6af4a92b3..94a6cb11f392501c4cecc79e13f2d16dca2dd560 100644 (file)
@@ -2498,17 +2498,17 @@ static void php_odbc_lasterror(INTERNAL_FUNCTION_PARAMETERS, int mode)
     if (argc == 1) {
         ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_handle, -1, "ODBC-Link", le_conn, le_pconn);
         if (mode == 0) {
-            strncpy(ptr, conn->laststate, len);
+            strlcpy(ptr, conn->laststate, len+1);
         } else {
-            strncpy(ptr, conn->lasterrormsg, len);
+            strlcpy(ptr, conn->lasterrormsg, len+1);
         }
     } else {
                ODBCLS_FETCH();
 
         if (mode == 0) {
-            strncpy(ptr, ODBCG(laststate), len);
+            strlcpy(ptr, ODBCG(laststate), len+1);
         } else {
-            strncpy(ptr, ODBCG(lasterrormsg), len);
+            strlcpy(ptr, ODBCG(lasterrormsg), len+1);
         }
     }
     RETVAL_STRING(ptr, 0);