version 1.78, 2014/05/06 23:50:53 |
version 1.79, 2014/05/14 15:33:41 |
|
|
char buf[1024]; |
char buf[1024]; |
char *line, *endline; |
char *line, *endline; |
struct checksum *checksums = NULL, *c = NULL; |
struct checksum *checksums = NULL, *c = NULL; |
int nchecksums = 0; |
int nchecksums = 0, checksumspace = 0; |
int i, j, rv, uselist, count, hasfailed; |
int i, j, rv, uselist, count, hasfailed; |
int *failures; |
int *failures; |
|
|
line = msg; |
line = msg; |
while (line && *line) { |
while (line && *line) { |
if (!(checksums = reallocarray(checksums, |
if (nchecksums == checksumspace) { |
nchecksums + 1, sizeof(*checksums)))) |
checksumspace = 2 * (nchecksums + 1); |
err(1, "realloc"); |
if (!(checksums = reallocarray(checksums, |
|
checksumspace, sizeof(*checksums)))) |
|
err(1, "realloc"); |
|
} |
c = &checksums[nchecksums++]; |
c = &checksums[nchecksums++]; |
if ((endline = strchr(line, '\n'))) |
if ((endline = strchr(line, '\n'))) |
*endline++ = '\0'; |
*endline++ = '\0'; |