From: Andi Gutmans Date: Wed, 2 May 2001 22:53:41 +0000 (+0000) Subject: - Another strncpy() -> strlcpy() change X-Git-Tag: php-4.0.6RC1~177 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8975186810807ae4275ced6db70bb67ae9b2b75a;p=php - Another strncpy() -> strlcpy() change --- diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c index f65421270e..e949cc77d9 100644 --- a/sapi/thttpd/thttpd.c +++ b/sapi/thttpd/thttpd.c @@ -174,9 +174,7 @@ static void sapi_thttpd_register_variables(zval *track_vars_array ELS_DC SLS_DC php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array ELS_CC PLS_CC); php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array ELS_CC PLS_CC); - buf[BUF_SIZE] = '\0'; - - strncpy(buf, inet_ntoa(TG(hc)->client_addr.sa_in.sin_addr), BUF_SIZE); + strlcpy(buf, inet_ntoa(TG(hc)->client_addr.sa_in.sin_addr), sizeof(buf)); ADD_STRING("REMOTE_ADDR"); ADD_STRING("REMOTE_HOST");