* 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
*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;
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;
}
return output;
}
- return str;
+ return (char*) str;
failure:
return NULL;
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);
***/
const char *pa_utf8_valid(const char *str);
-const char *pa_utf8_filter(const char *str);
+char *pa_utf8_filter(const char *str);
#endif