Commit cda9f847 authored by Robert Edmonds's avatar Robert Edmonds

protoc-c: Silence compilers that complain about sprintf()

parent 951a5278
...@@ -526,7 +526,7 @@ static int CEscapeInternal(const char* src, int src_len, char* dest, ...@@ -526,7 +526,7 @@ static int CEscapeInternal(const char* src, int src_len, char* dest,
if (!isprint(*src) || (last_hex_escape && isxdigit(*src))) { if (!isprint(*src) || (last_hex_escape && isxdigit(*src))) {
if (dest_len - used < 4) // need space for 4 letter escape if (dest_len - used < 4) // need space for 4 letter escape
return -1; return -1;
sprintf(dest + used, (use_hex ? "\\x%02x" : "\\%03o"), snprintf(dest + used, dest_len - used, (use_hex ? "\\x%02x" : "\\%03o"),
static_cast<uint8>(*src)); static_cast<uint8>(*src));
is_hex_escape = use_hex; is_hex_escape = use_hex;
used += 4; used += 4;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment