aboutsummaryrefslogtreecommitdiff
path: root/src/vdf/vdf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vdf/vdf.c')
-rw-r--r--src/vdf/vdf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vdf/vdf.c b/src/vdf/vdf.c
index 160577f..2708a5d 100644
--- a/src/vdf/vdf.c
+++ b/src/vdf/vdf.c
@@ -43,6 +43,9 @@ struct vdf_object* vdf_parse_buffer(const char* buffer, size_t size)
switch (*tail)
{
case CHAR_DOUBLE_QUOTE:
+ if (tail > buffer && *(tail-1) == CHAR_BACKSLASH)
+ break;
+
if (!buf)
{
buf = tail+1;
@@ -115,7 +118,9 @@ struct vdf_object* vdf_parse_buffer(const char* buffer, size_t size)
else
{
size_t len = tail - buf;
- o->key = strndup(buf, len);
+ o->key = malloc(len+1);
+ strncpy(o->key, buf, len);
+ o->key[len] = '\0';
buf = NULL;
}
break;