From 198b02f7dd61c6cb9fd4c379dc56edcf537a7ee1 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 31 Dec 2013 23:22:36 +0100 Subject: fix failures found by randomconfig builds Signed-off-by: Denys Vlasenko --- libbb/nuke_str.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 libbb/nuke_str.c (limited to 'libbb/nuke_str.c') 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 @@ +/* vi: set sw=4 ts=4: */ +/* + * Utility routines. + * + * Copyright (C) 2008 Denys Vlasenko + * + * Licensed under GPLv2, see file LICENSE in this source tree. + */ + +//kbuild:lib-y += nuke_str.o + +#include "libbb.h" + +void FAST_FUNC nuke_str(char *str) +{ + if (str) { + while (*str) + *str++ = 0; + /* or: memset(str, 0, strlen(str)); - not as small as above */ + } +} -- cgit v1.2.3