Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/citrus s == NULL is illegal.



details:   https://anonhg.NetBSD.org/src/rev/43db08a3cc92
branches:  trunk
changeset: 825421:43db08a3cc92
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jul 13 16:00:30 2017 +0000

description:
s == NULL is illegal.

diffstat:

 lib/libc/citrus/citrus_none.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 620995c27ca4 -r 43db08a3cc92 lib/libc/citrus/citrus_none.c
--- a/lib/libc/citrus/citrus_none.c     Thu Jul 13 15:46:26 2017 +0000
+++ b/lib/libc/citrus/citrus_none.c     Thu Jul 13 16:00:30 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: citrus_none.c,v 1.21 2017/07/13 15:46:26 joerg Exp $   */
+/*     $NetBSD: citrus_none.c,v 1.22 2017/07/13 16:00:30 christos Exp $        */
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_none.c,v 1.21 2017/07/13 15:46:26 joerg Exp $");
+__RCSID("$NetBSD: citrus_none.c,v 1.22 2017/07/13 16:00:30 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <assert.h>
@@ -513,7 +513,10 @@
                           void * __restrict pspriv,
                           size_t * __restrict nresult)
 {
-       if (s == NULL || *s == NULL) {
+
+       _DIAGASSERT(s != NULL);
+
+       if (*s == NULL) {
                *nresult = 0;
                return (0);
        }



Home | Main Index | Thread Index | Old Index