Explorar o código

fix signed char to unsigned char conversion in utf8_charbytes()

Ryan Whitworth %!s(int64=5) %!d(string=hai) anos
pai
achega
7aff27b0ee
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/utils/gravity_utils.c

+ 1 - 1
src/utils/gravity_utils.c

@@ -469,7 +469,7 @@ end_repl_str:
  */
 
 inline uint32_t utf8_charbytes (const char *s, uint32_t i) {
-    unsigned char c = s[i];
+    unsigned char c = (unsigned char)s[i];
     
     // determine bytes needed for character, based on RFC 3629
     if ((c > 0) && (c <= 127)) return 1;