diff options
Diffstat (limited to 'com32/lib/chrreplace.c')
-rw-r--r-- | com32/lib/chrreplace.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/com32/lib/chrreplace.c b/com32/lib/chrreplace.c new file mode 100644 index 00000000..65786f94 --- /dev/null +++ b/com32/lib/chrreplace.c @@ -0,0 +1,11 @@ +#include <ctype.h> + +/* Replace char 'old' by char 'new' in source */ +void chrreplace(char *source, char old, char new) +{ + while (*source) { + source++; + if (source[0] == old) source[0]=new; + } +} + |