1
0
mirror of https://gitlab.com/80486DX2-66/gists synced 2024-11-12 22:45:54 +05:30

freadln.c: add a test

This commit is contained in:
Intel A80486DX2-66 2024-03-10 14:14:38 +03:00
parent 9d47a1d50b
commit 9a2979efe5
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -68,3 +68,16 @@ int freadln(char** output, size_t* length_out) {
errno = 0;
freadln_success_epilogue;
}
#ifdef TEST
int main(void) {
printf("Type something> ");
char* line;
if (freadln(&line, NULL) != freadln_OK) {
perror("freadln");
exit(EXIT_FAILURE);
}
printf("Input string: '%s'\n", line);
return 0;
}
#endif