[git commit] ash: code shrink

Denys Vlasenko vda.linux at googlemail.com
Sat Jun 17 18:45:02 UTC 2023


commit: https://git.busybox.net/busybox/commit/?id=d0441222db80c6fc0c47fa014106d38e25bfada7
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

function                                             old     new   delta
setvar                                               166     164      -2

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/ash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shell/ash.c b/shell/ash.c
index 51b627fcc..dde36dd7c 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -2506,7 +2506,7 @@ setvar(const char *name, const char *val, int flags)
 	p = mempcpy(nameeq, name, namelen);
 	if (val) {
 		*p++ = '=';
-		memcpy(p, val, vallen);
+		strcpy(p, val);
 	}
 	vp = setvareq(nameeq, flags | VNOSAVE);
 	INT_ON;


More information about the busybox-cvs mailing list