diff --git a/protobuf-c-text/generate.c b/protobuf-c-text/generate.c index b326c6e..6a2b414 100644 --- a/protobuf-c-text/generate.c +++ b/protobuf-c-text/generate.c @@ -148,7 +148,7 @@ esc_str(char *src, int len, ProtobufCAllocator *allocator) /* Escape with octal if !isprint. */ default: if (!isprint(src[i])) { - dst_len += sprintf(dst + dst_len, "\\%03o", src[i]); + dst_len += sprintf(dst + dst_len, "\\%03o", (unsigned char)src[i]); } else { dst[dst_len++] = src[i]; }