diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-12-31 23:22:36 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-12-31 23:22:36 +0100 |
commit | 198b02f7dd61c6cb9fd4c379dc56edcf537a7ee1 (patch) | |
tree | 055b2ab0f2636e100781ddefdbf95417e44bb6df /libbb/nuke_str.c | |
parent | 61be8e46a80749fe5bb16bc8f831c689d21a4e34 (diff) | |
download | busybox-w32-198b02f7dd61c6cb9fd4c379dc56edcf537a7ee1.tar.gz busybox-w32-198b02f7dd61c6cb9fd4c379dc56edcf537a7ee1.tar.bz2 busybox-w32-198b02f7dd61c6cb9fd4c379dc56edcf537a7ee1.zip |
fix failures found by randomconfig builds
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/nuke_str.c')
-rw-r--r-- | libbb/nuke_str.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libbb/nuke_str.c b/libbb/nuke_str.c new file mode 100644 index 000000000..56b808bc7 --- /dev/null +++ b/libbb/nuke_str.c | |||
@@ -0,0 +1,21 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
2 | /* | ||
3 | * Utility routines. | ||
4 | * | ||
5 | * Copyright (C) 2008 Denys Vlasenko | ||
6 | * | ||
7 | * Licensed under GPLv2, see file LICENSE in this source tree. | ||
8 | */ | ||
9 | |||
10 | //kbuild:lib-y += nuke_str.o | ||
11 | |||
12 | #include "libbb.h" | ||
13 | |||
14 | void FAST_FUNC nuke_str(char *str) | ||
15 | { | ||
16 | if (str) { | ||
17 | while (*str) | ||
18 | *str++ = 0; | ||
19 | /* or: memset(str, 0, strlen(str)); - not as small as above */ | ||
20 | } | ||
21 | } | ||