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/Kbuild.src | 2 +- libbb/correct_password.c | 9 --------- libbb/in_ether.c | 1 + libbb/nuke_str.c | 21 +++++++++++++++++++++ 4 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 libbb/nuke_str.c (limited to 'libbb') diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src index c5d86c0..a6468f1 100644 --- a/libbb/Kbuild.src +++ b/libbb/Kbuild.src @@ -144,7 +144,7 @@ lib-$(CONFIG_DELUSER) += update_passwd.o lib-$(CONFIG_PASSWD) += pw_encrypt.o update_passwd.o obscure.o lib-$(CONFIG_CHPASSWD) += pw_encrypt.o update_passwd.o lib-$(CONFIG_CRYPTPW) += pw_encrypt.o -lib-$(CONFIG_SULOGIN) += pw_encrypt.o +lib-$(CONFIG_SULOGIN) += pw_encrypt.o correct_password.o lib-$(CONFIG_VLOCK) += pw_encrypt.o correct_password.o lib-$(CONFIG_SU) += pw_encrypt.o correct_password.o lib-$(CONFIG_LOGIN) += pw_encrypt.o correct_password.o diff --git a/libbb/correct_password.c b/libbb/correct_password.c index 5727c65..acadf39 100644 --- a/libbb/correct_password.c +++ b/libbb/correct_password.c @@ -30,15 +30,6 @@ #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 */ - } -} - /* Ask the user for a password. * Return 1 without asking if PW has an empty password. * Return -1 on EOF, error while reading input, or timeout. diff --git a/libbb/in_ether.c b/libbb/in_ether.c index dadadba..1de383b 100644 --- a/libbb/in_ether.c +++ b/libbb/in_ether.c @@ -3,6 +3,7 @@ * Utility routines. */ +//kbuild:lib-$(CONFIG_ARP) += in_ether.o //kbuild:lib-$(CONFIG_IFCONFIG) += in_ether.o //kbuild:lib-$(CONFIG_IFENSLAVE) += in_ether.o diff --git a/libbb/nuke_str.c b/libbb/nuke_str.c new file mode 100644 index 0000000..56b808b --- /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.1