changes on checkPointer to add message

This commit is contained in:
Théophyl Hoguet committed 2022-03-05 22:19:43 +01:00
1 parent d90e7f0e10
commit b514e98e70
4 files changed
+11 -12

No files matched your search

+2 -3
View File
@@ -13,7 +13,6 @@ void usage() {
}
int main(int argc, char* argv[]) {
// check if nb of param is correct
if (argc != 3 && argc != 4) {
// nb param is not correct
@@ -48,8 +47,8 @@ int main(int argc, char* argv[]) {
if (argc == 4) {
char* filename = argv[3];
FILE* f = fopen(filename, "w");
checkPointer((void*)f);
test_output(fprintf(f, "%u\n", nbsolutions), 2, "Error in scan of file");
checkPointer((void*)f, "Couldn't open file\n");
test_output(fprintf(f, "%u\n", nbsolutions), 2, "Error in scan of file\n");
fclose(f);
}
}