i-bash/lib/sh/memset.c

30 lines
930 B
C
Raw Normal View History

2009-01-12 13:36:28 +00:00
/* memset.c -- set an area of memory to a given value */
2002-07-17 14:10:11 +00:00
2009-01-12 13:36:28 +00:00
/* Copyright (C) 1991-2002 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software: you can redistribute it and/or modify
2002-07-17 14:10:11 +00:00
it under the terms of the GNU General Public License as published by
2009-01-12 13:36:28 +00:00
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
2002-07-17 14:10:11 +00:00
2009-01-12 13:36:28 +00:00
Bash is distributed in the hope that it will be useful,
2002-07-17 14:10:11 +00:00
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
2009-01-12 13:36:28 +00:00
along with Bash. If not, see <http://www.gnu.org/licenses/>.
*/
2002-07-17 14:10:11 +00:00
char *
memset (char *str, int c, unsigned int len)
{
register char *st = str;
while (len-- > 0)
*st++ = c;
return str;
}