diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-11-08 18:23:11 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-11-08 18:23:11 +0100 |
commit | 2e813ecec7fcc8358c44d3f6cfd9f942404b3749 (patch) | |
tree | e4c81910f06bd7e89b3849d292dc7e921d3ec09f | |
parent | m (diff) | |
download | mds-2e813ecec7fcc8358c44d3f6cfd9f942404b3749.tar.gz mds-2e813ecec7fcc8358c44d3f6cfd9f942404b3749.tar.bz2 mds-2e813ecec7fcc8358c44d3f6cfd9f942404b3749.tar.xz |
m + buf fix: wrong element size on malloc
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/mds-kbdc/raw-data.c | 9 |
1 files changed, 5 insertions, 4 deletions
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 <libmdsserver/macros.h> + #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> @@ -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++) |