From ee1eefc8ece19796aadbdc3055d5f0efa1c0eb93 Mon Sep 17 00:00:00 2001 From: rillig Date: Wed, 12 Aug 2020 18:47:21 +0000 Subject: [PATCH] make(1): remove unnecessary test from bmake_strndup The passed memory is never NULL. --- usr.bin/make/make_malloc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/usr.bin/make/make_malloc.c b/usr.bin/make/make_malloc.c index 17c7f63a5b5b..343428b9566b 100644 --- a/usr.bin/make/make_malloc.c +++ b/usr.bin/make/make_malloc.c @@ -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 -__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 @@ -92,9 +92,6 @@ bmake_strndup(const char *str, size_t max_len) size_t len; char *p; - if (str == NULL) - return NULL; - for (len = 0; len < max_len; len++) if (str[len] == '\0') break;