36 |
|
|
37 |
*/ |
*/ |
38 |
|
|
|
|
|
|
/* for strndup */ |
|
|
#define _GNU_SOURCE |
|
39 |
#include "config.h" |
#include "config.h" |
40 |
#include "compat.h" |
#include "compat.h" |
41 |
#include "misc.h" |
#include "misc.h" |
237 |
} |
} |
238 |
|
|
239 |
num_lines++; |
num_lines++; |
240 |
buf = (char *)strndup(line_begin, line_end - line_begin); |
buf = malloc(line_end - line_begin + 1); |
241 |
|
strncpy(buf, line_begin, line_end - line_begin); |
242 |
|
buf[line_end - line_begin] = 0; |
243 |
split_lines = realloc(split_lines, |
split_lines = realloc(split_lines, |
244 |
(num_lines + 1) * sizeof(char*)); |
(num_lines + 1) * sizeof(char*)); |
245 |
split_lines[num_lines - 1] = buf; |
split_lines[num_lines - 1] = buf; |