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 redundant call to strlen in Str...



details:   https://anonhg.NetBSD.org/src/rev/05156d48723c
branches:  trunk
changeset: 979068:05156d48723c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Dec 12 19:13:47 2020 +0000

description:
make(1): remove redundant call to strlen in Str_Words

diffstat:

 usr.bin/make/str.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 72518ce7205a -r 05156d48723c usr.bin/make/str.c
--- a/usr.bin/make/str.c        Sat Dec 12 18:53:53 2020 +0000
+++ b/usr.bin/make/str.c        Sat Dec 12 19:13:47 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: str.c,v 1.74 2020/11/16 18:28:27 rillig Exp $  */
+/*     $NetBSD: str.c,v 1.75 2020/12/12 19:13:47 rillig Exp $  */
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -71,7 +71,7 @@
 #include "make.h"
 
 /*     "@(#)str.c      5.8 (Berkeley) 6/1/90"  */
-MAKE_RCSID("$NetBSD: str.c,v 1.74 2020/11/16 18:28:27 rillig Exp $");
+MAKE_RCSID("$NetBSD: str.c,v 1.75 2020/12/12 19:13:47 rillig Exp $");
 
 /* Return the concatenation of s1 and s2, freshly allocated. */
 char *
@@ -142,7 +142,7 @@
 
        /* words_buf holds the words, separated by '\0'. */
        str_len = strlen(str);
-       words_buf = bmake_malloc(strlen(str) + 1);
+       words_buf = bmake_malloc(str_len + 1);
 
        words_cap = str_len / 5 > 50 ? str_len / 5 : 50;
        words = bmake_malloc((words_cap + 1) * sizeof(char *));



Home | Main Index | Thread Index | Old Index