* remove some compiler warnings
* use our own pa_xmalloc() implementation instead of libc's malloc()
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@874
fefdeb5f-60dc-0310-8127-
8f9354f1896f
#include <string.h>
#include "utf8.h"
+#include "xmalloc.h"
#define FILTER_CHAR '_'
int size;
uint8_t *o;
- o = output;
- for (p = (uint8_t*)str; *p; p++, o++) {
+ o = (uint8_t*) output;
+ for (p = (const uint8_t*) str; *p; p++) {
if (*p < 128) {
if (o)
- *output = *p;
+ *o = *p;
} else {
last = p;
o += size - 1;
}
+ if (o)
+ o++;
+
continue;
error:
} else
goto failure;
}
+
+ if (o)
+ o++;
}
if (o) {
const char* pa_utf8_filter (const char *str) {
char *new_str;
- new_str = malloc(strlen(str) + 1);
- assert(new_str);
+ new_str = pa_xnew(char, strlen(str) + 1);
return utf8_validate(str, new_str);
}