Files
RedBear-OS/tests/stdio/fwrite.c
T
Tibor Nagy 4381bb2a22 tests: Remove redundant return statements
When the execution reaches the end of the main functions, they implicitly return a successful status.
2019-02-20 21:09:03 +01:00

24 lines
372 B
C

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
int main(void) {
FILE *f = fopen("stdio/fwrite.out", "w");
const char ptr[] = "Hello World!";
if (fwrite(ptr, 0, 17, f)) {
return EXIT_FAILURE;
}
if (fwrite(ptr, 7, 0, f)) {
return EXIT_FAILURE;
}
if (fwrite(ptr, 0, 0, f)) {
return EXIT_FAILURE;
}
fwrite(ptr, sizeof(ptr), 1, f);
fclose(f);
}