From eb4d840a40eb2ca2736a0d2026bd5d5f247b39f4 Mon Sep 17 00:00:00 2001 From: Andi Gutmans Date: Wed, 2 May 2001 23:20:04 +0000 Subject: [PATCH] - More strncpy() -> strlcpy() changes. Am I getting bored yet? :) --- ext/odbc/php_odbc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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); -- 2.40.0