Escape DEL character in config_item_write_string()

This commit is contained in:
Přemysl Eric Janouch 2020-10-31 21:27:30 +01:00
parent d71c47f8ce
commit 960420df3e
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 9 additions and 7 deletions

View File

@ -4713,8 +4713,10 @@ config_item_write_string (struct str *output, const struct str *s)
else if (c == '\t') str_append (output, "\\t"); else if (c == '\t') str_append (output, "\\t");
else if (c == '\\') str_append (output, "\\\\"); else if (c == '\\') str_append (output, "\\\\");
else if (c == '"') str_append (output, "\\\""); else if (c == '"') str_append (output, "\\\"");
else if (c < 32) str_append_printf (output, "\\x%02x", c); else if (iscntrl_ascii (c))
else str_append_c (output, c); str_append_printf (output, "\\x%02x", c);
else
str_append_c (output, c);
} }
str_append_c (output, '"'); str_append_c (output, '"');
} }