X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Futf8.c;h=5f9f3c60c52b6f9b4224964a74b2e8caf92935a3;hp=a6f5b3f9e5dff38fc28efd4eb1d47943a2f49a87;hb=67445f4e22ad924394acdd4fd49e6f238244a5ca;hpb=ba961854ddec8a8efcffab44540c33cc7dffebfa diff --git a/src/shared/utf8.c b/src/shared/utf8.c index a6f5b3f9e..5f9f3c60c 100644 --- a/src/shared/utf8.c +++ b/src/shared/utf8.c @@ -265,7 +265,8 @@ char *ascii_is_valid(const char *str) { } char *ascii_filter(const char *str) { - char *r, *s, *d; + const char *s; + char *r, *d; size_t l; assert(str); @@ -275,7 +276,7 @@ char *ascii_filter(const char *str) { if (!r) return NULL; - for (s = r, d = r; *s; s++) + for (s = str, d = r; *s; s++) if ((unsigned char) *s < 128) *(d++) = *s;