MCPcopy Create free account
hub / github.com/TASEmulators/fceux / chr_replace

Function chr_replace

src/utils/xstring.cpp:142–153  ·  view source on GitHub ↗

Replaces all instances of 'search' with 'replace' Returns number of characters modified

Source from the content-addressed store, hash-verified

140///Replaces all instances of 'search' with 'replace'
141///Returns number of characters modified
142int chr_replace(char *str, char search, char replace) {
143 unsigned int i=0,j=0; //mbg merge 7/17/06 changed to unsigned int
144
145 while (i < strlen(str)) {
146 if (str[i] == search) {
147 str[i] = replace;
148 j++;
149 }
150 i++;
151 }
152 return j;
153}
154
155
156///Sub-String replacement routine

Callers 1

AssembleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected