566 |
|
|
567 |
static int write_json(Coverage * coverage, const char * path) { |
static int write_json(Coverage * coverage, const char * path) { |
568 |
/* write the JSON */ |
/* write the JSON */ |
569 |
FILE * f = fopen(path, "w"); |
FILE * f = fopen(path, "wb"); |
570 |
if (f == NULL) { |
if (f == NULL) { |
571 |
return -1; |
return -1; |
572 |
} |
} |
630 |
struct stat buf; |
struct stat buf; |
631 |
if (stat(path, &buf) == 0) { |
if (stat(path, &buf) == 0) { |
632 |
/* it exists: merge */ |
/* it exists: merge */ |
633 |
FILE * f = fopen(path, "r"); |
FILE * f = fopen(path, "rb"); |
634 |
if (f == NULL) { |
if (f == NULL) { |
635 |
result = 1; |
result = 1; |
636 |
} |
} |