Skip to content

Commit

Permalink
vcard_test.c: init data buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
ksmurchison committed Apr 22, 2024
1 parent 787aeac commit 7aea32b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/test/libicalvcard/vcard_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ int main(int argc, const char **argv)

fstat(fd, &sbuf);
data = malloc(sbuf.st_size+1);
memset(data, 0, sbuf.st_size+1);

int r = read(fd, data, sbuf.st_size);
if (r < 0) {
fprintf(stderr, "Failed to read vCard\n");
return -1;
}
data[r+1] = '\0';

vcardcomponent *card = vcardparser_parse_string(data);
free(data);
Expand Down

0 comments on commit 7aea32b

Please sign in to comment.