Add more sanitizing characters.

This commit is contained in:
Danila Fedorin 2018-08-10 16:54:39 -07:00
parent d0615d2c3e
commit fdca2a8ca7
1 changed files with 3 additions and 1 deletions

View File

@ -87,7 +87,9 @@ libab_result libab_init(libab* ab, void* (*parse_function)(const char*),
void _sanitize(char* to, const char* from, size_t buffer_size) {
size_t index = 0;
while (*from && index < (buffer_size - 2)) {
if (*from == '+' || *from == '*' || *from == '\\')
if (*from == '+' || *from == '*' || *from == '\\' ||
*from == '|' || *from == '[' || *from == ']' || *from == '(' ||
*from == ')')
to[index++] = '\\';
to[index++] = *(from++);
}