summaryrefslogtreecommitdiffhomepage
path: root/libbb/nuke_str.c
blob: b5385e956929da4cb65f4365bafe54f245b7d8ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* 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 */
	}
}