edc_parser: Fix to allocate correct size of memory for string.

Allocate one more char memory for the last null character of the string.
This commit fixes the commit 335575eb84.
This commit is contained in:
Jaehyun Cho 2016-01-22 21:17:19 +09:00
parent 3fb96ced83
commit 0c15bde219
1 changed files with 2 additions and 1 deletions

View File

@ -95,7 +95,8 @@ double_quotation_marks_remove(const char *str)
}
new_len = len - cnt;
new_str = (char *) calloc(new_len * sizeof(char), 1);
//Allocate one more char for last null character
new_str = (char *) calloc((new_len + 1) * sizeof(char), 1);
j = 0;
for (i = 0; i < len; i++)
{