From 2e813ecec7fcc8358c44d3f6cfd9f942404b3749 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 8 Nov 2014 18:23:11 +0100 Subject: m + buf fix: wrong element size on malloc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-kbdc/raw-data.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mds-kbdc') diff --git a/src/mds-kbdc/raw-data.c b/src/mds-kbdc/raw-data.c index fcdf4ad..270fdd6 100644 --- a/src/mds-kbdc/raw-data.c +++ b/src/mds-kbdc/raw-data.c @@ -20,6 +20,7 @@ #include "globals.h" #include + #include #include #include @@ -158,9 +159,9 @@ static size_t remove_comments(char* restrict content, size_t size) else if (escape) t, escape = 0; else if (quote) { - t; - if (c == '\\') escape = 1; - else if (c == '"') quote = 0; + t + if (c == '\\') escape = 1; + else if (c == '"') quote = 0; } /* # is the comment symbol. */ else if (c == '#') comment = 1; @@ -205,7 +206,7 @@ static char** line_split(char* content, size_t length) if (content[i] == '\n') count++; - fail_if (xmalloc(lines, count + 1, char)); + fail_if (xmalloc(lines, count + 1, char*)); lines[count] = NULL; for (i = j = 0; i < length; i++) -- cgit v1.2.3-70-g09d2