From 2b3d429a0514952f73ae94f3a5c2db00391cbc86 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 9 Sep 2016 18:02:43 +0200 Subject: init: replace strcpy() with my_strcpy() strpcy() is large and used only once, let's get rid of it. --- init/init.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init/init.c b/init/init.c index ea97401..c095848 100644 --- a/init/init.c +++ b/init/init.c @@ -470,6 +470,11 @@ static void my_memmove(char *dst, const char *src, int len) } } +static void my_strcpy(char *dst, const char *src) +{ + while ((*dst++ = *src++)); +} + /* * copies at most chars from to . Last char is always * set to 0, unless is 0. The number of chars copied is returned @@ -1865,7 +1870,7 @@ int main(int argc, char **argv, char **envp) { int ret, rem; int status; - strcpy(argv[0], "init: terminal cleaner"); + my_strcpy(argv[0], "init: terminal cleaner"); ret = waitpid(res, &status, 0); -- 1.7.12.1