X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=json.c;fp=json.c;h=1d0c169449657c49970390ebf76cf98ce11be2e8;hp=f90b0fa245324204347070d870ac22257e0d6f95;hb=4a442846926f7e3d1b30b7afac59dd1def0e5a41;hpb=22d117d14497ddea11014cab2f25d1be57210de2 diff --git a/json.c b/json.c index f90b0fa2..1d0c1694 100644 --- a/json.c +++ b/json.c @@ -63,7 +63,7 @@ json_quote_chararray(const void *ctx, const char *str, const size_t len) for (loop = 0, required = 0, ptr = str; loop < len; loop++, required++, ptr++) { - if (*ptr < 32 || *ptr == '\"' || *ptr == '\\') + if ((unsigned char)(*ptr) < 32 || *ptr == '\"' || *ptr == '\\') required++; } @@ -80,7 +80,7 @@ json_quote_chararray(const void *ctx, const char *str, const size_t len) *ptr2++ = '\"'; for (loop = 0; loop < len; loop++) { - if (*ptr > 31 && *ptr != '\"' && *ptr != '\\') { + if ((unsigned char)(*ptr) > 31 && *ptr != '\"' && *ptr != '\\') { *ptr2++ = *ptr++; } else { *ptr2++ = '\\';