[polypaudio-commits] r877 - in /trunk/src/polypcore: utf8.c utf8.h

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Mon May 15 17:44:47 PDT 2006


Author: lennart
Date: Tue May 16 02:44:47 2006
New Revision: 877

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=877&root=polypaudio&view=rev
Log:
* 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

Modified:
    trunk/src/polypcore/utf8.c
    trunk/src/polypcore/utf8.h

Modified: trunk/src/polypcore/utf8.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/utf8.c?rev=877&root=polypaudio&r1=876&r2=877&view=diff
==============================================================================
--- trunk/src/polypcore/utf8.c (original)
+++ trunk/src/polypcore/utf8.c Tue May 16 02:44:47 2006
@@ -61,7 +61,7 @@
     *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 @@
 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 @@
         return output;
     }
 
-    return str;
+    return (char*) str;
 
 failure:
     return NULL;
@@ -155,7 +155,7 @@
     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);

Modified: trunk/src/polypcore/utf8.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/utf8.h?rev=877&root=polypaudio&r1=876&r2=877&view=diff
==============================================================================
--- trunk/src/polypcore/utf8.h (original)
+++ trunk/src/polypcore/utf8.h Tue May 16 02:44:47 2006
@@ -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




More information about the pulseaudio-commits mailing list