1b3e94a20d
From release 0.1.0 pre-patched archive. This includes all Red Bear modifications previously maintained as patches in local/patches/relibc/.
28 lines
478 B
C
28 lines
478 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <errno.h>
|
|
|
|
#include "test_helpers.h"
|
|
|
|
int main(void) {
|
|
FILE *f = fopen("stdio/fwrite.out", "w");
|
|
ERROR_IF(fopen, f, == NULL);
|
|
|
|
const char ptr[] = "Hello World!";
|
|
|
|
if (fwrite(ptr, 0, 17, f)) {
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
|
|
if (fwrite(ptr, 7, 0, f)) {
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
|
|
if (fwrite(ptr, 0, 0, f)) {
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
|
|
fwrite(ptr, sizeof(ptr), 1, f);
|
|
fclose(f);
|
|
}
|