Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/dist/pppd/pppd Simplify.



details:   https://anonhg.NetBSD.org/src/rev/dd5b34f473c7
branches:  trunk
changeset: 770182:dd5b34f473c7
user:      joerg <joerg%NetBSD.org@localhost>
date:      Fri Oct 07 10:42:54 2011 +0000

description:
Simplify.

diffstat:

 dist/pppd/pppd/auth.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (37 lines):

diff -r 94352cf982e8 -r dd5b34f473c7 dist/pppd/pppd/auth.c
--- a/dist/pppd/pppd/auth.c     Fri Oct 07 10:38:02 2011 +0000
+++ b/dist/pppd/pppd/auth.c     Fri Oct 07 10:42:54 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auth.c,v 1.7 2006/11/05 09:16:20 martin Exp $  */
+/*     $NetBSD: auth.c,v 1.8 2011/10/07 10:42:54 joerg Exp $   */
 
 /*
  * auth.c - PPP authentication and phase control.
@@ -75,7 +75,7 @@
 #if 0
 #define RCSID  "Id: auth.c,v 1.112 2006/06/18 11:26:00 paulus Exp"
 #else
-__RCSID("$NetBSD: auth.c,v 1.7 2006/11/05 09:16:20 martin Exp $");
+__RCSID("$NetBSD: auth.c,v 1.8 2011/10/07 10:42:54 joerg Exp $");
 #endif
 #endif
 
@@ -2459,14 +2459,15 @@
         */
        app = &alist;
        for (;;) {
+           size_t len;
            if (!getword(f, word, &newline, filename) || newline)
                break;
-           ap = (struct wordlist *)
-                   malloc(sizeof(struct wordlist) + strlen(word) + 1);
+           len = strlen(word) + 1;
+           ap = (struct wordlist *)malloc(sizeof(struct wordlist) + len);
            if (ap == NULL)
                novm("authorized addresses");
            ap->word = (char *) (ap + 1);
-           strlcpy(ap->word, word, strlen(word) + 1);
+           memcpy(ap->word, word, len);
            *app = ap;
            app = &ap->next;
        }



Home | Main Index | Thread Index | Old Index