diff options
author | Lennart Poettering <lennart@poettering.net> | 2006-05-16 00:44:47 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2006-05-16 00:44:47 +0000 |
commit | e8cc63d75685bd264efaea2b7bce894ba182e2a2 (patch) | |
tree | 4fee080fb8473666247f71a07245b0a133b2a3b5 | |
parent | 23e74545adce1e23f6d3e09a0cbb9f1d98a7b933 (diff) |
* remove "const" from return type of pa_utf8_filter() since it desn't make any sense
* fix pa_utf8_filter() to not skip the next character too if it found an invalid one
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@877 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r-- | src/polypcore/utf8.c | 8 | ||||
-rw-r--r-- | src/polypcore/utf8.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/polypcore/utf8.c b/src/polypcore/utf8.c index 95b73d52..bb8621e2 100644 --- a/src/polypcore/utf8.c +++ b/src/polypcore/utf8.c @@ -61,7 +61,7 @@ static inline void merge_continuation_char(uint32_t *u_ch, uint8_t ch) { *u_ch |= ch & 0x3f; } -static const char* utf8_validate (const char *str, char *output) { +static char* utf8_validate(const char *str, char *output) { uint32_t val = 0; uint32_t min = 0; const uint8_t *p, *last; @@ -131,7 +131,7 @@ ONE_REMAINING: error: if (o) { *o = FILTER_CHAR; - p = last + 1; /* We retry at the next character */ + p = last; /* We retry at the next character */ } else goto failure; } @@ -145,7 +145,7 @@ error: return output; } - return str; + return (char*) str; failure: return NULL; @@ -155,7 +155,7 @@ const char* pa_utf8_valid (const char *str) { return utf8_validate(str, NULL); } -const char* pa_utf8_filter (const char *str) { +char* pa_utf8_filter (const char *str) { char *new_str; new_str = pa_xnew(char, strlen(str) + 1); diff --git a/src/polypcore/utf8.h b/src/polypcore/utf8.h index 5f1fc5df..6d1e4a7d 100644 --- a/src/polypcore/utf8.h +++ b/src/polypcore/utf8.h @@ -23,6 +23,6 @@ ***/ const char *pa_utf8_valid(const char *str); -const char *pa_utf8_filter(const char *str); +char *pa_utf8_filter(const char *str); #endif |