From: Andi Gutmans Date: Wed, 2 May 2001 23:20:04 +0000 (+0000) Subject: - More strncpy() -> strlcpy() changes. Am I getting bored yet? :) X-Git-Tag: php-4.0.6RC1~175 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb4d840a40eb2ca2736a0d2026bd5d5f247b39f4;p=php - More strncpy() -> strlcpy() changes. Am I getting bored yet? :) --- diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 15220393d4..94a6cb11f3 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -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);