[PATCH 5/6] libc/stdlib: Clean up clang warnings
Keith Packard via Newlib <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <[email protected]> |
Eliminate hand-written strcpy in setenv. Signed-off-by: Keith Packard <[email protected]> --- newlib/libc/stdlib/setenv_r.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newlib/libc/stdlib/setenv_r.c b/newlib/libc/stdlib/setenv_r.c index 84d87a6ed..cdfa04f33 100644 --- a/newlib/libc/stdlib/setenv_r.c +++ b/newlib/libc/stdlib/setenv_r.c @@ -75,7 +75,7 @@ _setenv_r (struct _reent *reent_ptr, } if (strlen (C) >= l_value) { /* old larger; copy over */ - while ((*C++ = *value++) != 0); + strcpy(C, value); ENV_UNLOCK; return 0; } -- 2.28.0