]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
lib/misc: a nicer fix for codeset
authorVMware, Inc <>
Mon, 26 Jul 2010 19:01:27 +0000 (12:01 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 26 Jul 2010 19:01:27 +0000 (12:01 -0700)
The uint8 ensures no signs get in the way. We're fine with them but
this way is even clearer.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/misc/codeset.c

index 3699bd430e88bfa659d0fb1c39a3a7693281ec72..e3821887b8b231c9f31780d8417a68ed7a615c5a 100644 (file)
@@ -1778,8 +1778,8 @@ CodeSet_UTF32ToUTF8(const char *utf32,  // IN:
                     char **utf8)        // OUT:
 {
    uint32 i;
-   char *p;
-   char *q;
+   uint8 *p;
+   uint8 *q;
    uint32 len;
    union {
       uint32  word;
@@ -1800,7 +1800,7 @@ CodeSet_UTF32ToUTF8(const char *utf32,  // IN:
     */
 
    len = 0;
-   p = (char *) utf32;
+   p = (uint8 *) utf32;
 
    while (TRUE) {
       value.bytes[0] = *p++;
@@ -1830,8 +1830,8 @@ CodeSet_UTF32ToUTF8(const char *utf32,  // IN:
     * UTF8 equivalent.
     */
 
-   p = (char *) utf32;
-   q = *utf8;
+   p = (uint8 *) utf32;
+   q = (uint8 *) *utf8;
 
    for (i = 0; i < len; i++) {
       value.bytes[0] = *p++;