Module Name: src
Committed By: rillig
Date: Fri Jan 7 08:30:04 UTC 2022
Modified Files:
src/usr.bin/make: make_malloc.c
Log Message:
make: rename local variable in bmake_malloc
The length of a string does not include the trailing '\0'.
No binary change.
To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/make/make_malloc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/make_malloc.c
diff -u src/usr.bin/make/make_malloc.c:1.25 src/usr.bin/make/make_malloc.c:1.26
--- src/usr.bin/make/make_malloc.c:1.25 Tue Jan 19 20:51:46 2021
+++ src/usr.bin/make/make_malloc.c Fri Jan 7 08:30:04 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: make_malloc.c,v 1.25 2021/01/19 20:51:46 rillig Exp $ */
+/* $NetBSD: make_malloc.c,v 1.26 2022/01/07 08:30:04 rillig Exp $ */
/*
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
#include "make.h"
-MAKE_RCSID("$NetBSD: make_malloc.c,v 1.25 2021/01/19 20:51:46 rillig Exp $");
+MAKE_RCSID("$NetBSD: make_malloc.c,v 1.26 2022/01/07 08:30:04 rillig Exp $");
#ifndef USE_EMALLOC
@@ -57,12 +57,12 @@ bmake_malloc(size_t len)
char *
bmake_strdup(const char *str)
{
- size_t len;
+ size_t size;
char *p;
- len = strlen(str) + 1;
- p = bmake_malloc(len);
- return memcpy(p, str, len);
+ size = strlen(str) + 1;
+ p = bmake_malloc(size);
+ return memcpy(p, str, size);
}
/* Allocate a string starting from str with exactly len characters. */