Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/net Add the terminating NUL as a regular character ...



details:   https://anonhg.NetBSD.org/src/rev/2e57b502835e
branches:  trunk
changeset: 349328:2e57b502835e
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Dec 07 02:48:54 2016 +0000

description:
Add the terminating NUL as a regular character addition.

diffstat:

 lib/libc/net/linkaddr.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 0476a97c5bf8 -r 2e57b502835e lib/libc/net/linkaddr.c
--- a/lib/libc/net/linkaddr.c   Wed Dec 07 02:36:41 2016 +0000
+++ b/lib/libc/net/linkaddr.c   Wed Dec 07 02:48:54 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linkaddr.c,v 1.18 2016/12/07 02:36:41 dholland Exp $   */
+/*     $NetBSD: linkaddr.c,v 1.19 2016/12/07 02:48:54 christos Exp $   */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)linkaddr.c 8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: linkaddr.c,v 1.18 2016/12/07 02:36:41 dholland Exp $");
+__RCSID("$NetBSD: linkaddr.c,v 1.19 2016/12/07 02:48:54 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -148,7 +148,7 @@
 
 #define ADDC(ch) \
        do { \
-               if (out >= obuf + sizeof(obuf) - 1) \
+               if (out >= obuf + sizeof(obuf)) \
                        return NULL; \
                *out++ = (ch); \
        } while (/*CONSTCOND*/0)
@@ -175,6 +175,6 @@
                } else
                        ADDC(hexlist[i]);
        }
-       *out = 0;
+       ADDC('\0');
        return (obuf);
 }



Home | Main Index | Thread Index | Old Index