Reactos
at master 50 lines 1.1 kB view raw
1/*** 2*strset.c - sets all characters of string to given character 3* 4* Copyright (c) Microsoft Corporation. All rights reserved. 5* 6*Purpose: 7* defines _strset() - sets all of the characters in a string (except 8* the '\0') equal to a given character. 9* 10*******************************************************************************/ 11 12#include <string.h> 13 14#if defined _M_X64 || defined _M_ARM || defined _M_ARM64 || _M_HYBRID 15 #pragma function(_strset) 16#endif 17 18/*** 19*char *_strset(string, val) - sets all of string to val 20* 21*Purpose: 22* Sets all of characters in string (except the terminating '/0' 23* character) equal to val. 24* 25* 26*Entry: 27* char *string - string to modify 28* char val - value to fill string with 29* 30*Exit: 31* returns string -- now filled with val's 32* 33*Uses: 34* 35*Exceptions: 36* 37*******************************************************************************/ 38 39char * __cdecl _strset ( 40 char * string, 41 int val 42 ) 43{ 44 char *start = string; 45 46 while (*string) 47 *string++ = (char)val; 48 49 return(start); 50}