Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make make(1): remove unnecessary test from bmake_str...



details:   https://anonhg.NetBSD.org/src/rev/cf0050ade588
branches:  trunk
changeset: 937232:cf0050ade588
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Aug 12 18:47:21 2020 +0000

description:
make(1): remove unnecessary test from bmake_strndup

The passed memory is never NULL.

diffstat:

 usr.bin/make/make_malloc.c |  7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diffs (28 lines):

diff -r 5ad0267e29f3 -r cf0050ade588 usr.bin/make/make_malloc.c
--- a/usr.bin/make/make_malloc.c        Wed Aug 12 18:30:46 2020 +0000
+++ b/usr.bin/make/make_malloc.c        Wed Aug 12 18:47:21 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make_malloc.c,v 1.13 2020/08/12 03:27:29 rillig Exp $  */
+/*     $NetBSD: make_malloc.c,v 1.14 2020/08/12 18:47:21 rillig Exp $  */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #ifdef MAKE_NATIVE
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: make_malloc.c,v 1.13 2020/08/12 03:27:29 rillig Exp $");
+__RCSID("$NetBSD: make_malloc.c,v 1.14 2020/08/12 18:47:21 rillig Exp $");
 #endif
 
 #include <stdio.h>
@@ -92,9 +92,6 @@
        size_t len;
        char *p;
 
-       if (str == NULL)
-               return NULL;
-
        for (len = 0; len < max_len; len++)
            if (str[len] == '\0')
                break;



Home | Main Index | Thread Index | Old Index