Messages in this thread |  | | Subject | Re: [PATCH v2 1/8] lib: string: Introduce strreplace | From | Joe Perches <> | Date | Mon, 08 Jun 2015 17:00:48 -0700 |
| |
On Tue, 2015-06-09 at 01:26 +0200, Rasmus Villemoes wrote: > Strings are sometimes sanitized by replacing a certain character > (often '/') by another (often '!'). [] > v2: spello fixed, parameters renamed 'old' and 'new' (just so the > kernel doc aligns nicely, and because that's what python -c > 'help(str.replace)' uses). Still EXPORT_SYMBOL, not inline (tried it, > caused more bloat), still called strreplace.
OK, thanks. I think the chars should be ints though just for consistency for strchr variants.
> diff --git a/include/linux/string.h b/include/linux/string.h [] > @@ -111,6 +111,7 @@ extern int memcmp(const void *,const void *,__kernel_size_t); > extern void * memchr(const void *,int,__kernel_size_t); > #endif > void *memchr_inv(const void *s, int c, size_t n); > +char *strreplace(char *s, char old, char new);
|  |