Re: cvs: php4 /ext/ncurses ncurses_functions.c

From: Date: Tue, 24 Dec 2002 17:33:10 +0000
Subject: Re: cvs: php4 /ext/ncurses ncurses_functions.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-17395@lists.php.net to get a copy of this message
http://www.courtesan.com/todd/papers/strlcpy.html It should be strlcpy(temp, blah, sizeof(temp)); That's one of the advantages of strlcpy(). It's much easier to use. Andi At 05:30 PM 12/24/2002 +0000, Ilia Alshanetsky wrote:
iliaa           Tue Dec 24 12:30:48 2002 EDT
Modified files:
    /php4/ext/ncurses   ncurses_functions.c
Log: Changed strncpy() to strlcpy(). Index: php4/ext/ncurses/ncurses_functions.c diff -u php4/ext/ncurses/ncurses_functions.c:1.33 php4/ext/ncurses/ncurses_functions.c:1.34 --- php4/ext/ncurses/ncurses_functions.c:1.33 Tue Dec 24 12:20:33 2002
+++ php4/ext/ncurses/ncurses_functions.c        Tue Dec 24 12:30:48 2002
@@ -1768,7 +1768,7 @@
        IS_NCURSES_INITIALIZED();
-       strncpy(temp, termname(), sizeof(temp) - 1);
+       strlcpy(temp, termname(), sizeof(temp) - 1);
        temp[sizeof(temp) - 1] = '\0';
        RETURN_STRINGL (temp, strlen(temp), 1);
@@ -1783,7 +1783,7 @@
        IS_NCURSES_INITIALIZED();
-       strncpy(temp, longname(), sizeof(temp) - 1);
+       strlcpy(temp, longname(), sizeof(temp) - 1);
        temp[sizeof(temp) - 1] = '\0';
        RETURN_STRINGL (temp, strlen(temp), 1);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.cvs (#17395) next »