]> granicus.if.org Git - php/commitdiff
- Another strncpy() -> strlcpy() change
authorAndi Gutmans <andi@php.net>
Wed, 2 May 2001 22:53:41 +0000 (22:53 +0000)
committerAndi Gutmans <andi@php.net>
Wed, 2 May 2001 22:53:41 +0000 (22:53 +0000)
sapi/thttpd/thttpd.c

index f65421270e707c549071076e4a623231dc2e133c..e949cc77d987941cbb439d70642c167983087710 100644 (file)
@@ -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");