1
0
mirror of https://gitlab.com/80486DX2-66/gists synced 2025-05-31 08:31:41 +05:30

freadln.c: add a test

This commit is contained in:
2024-03-10 14:14:38 +03:00
parent 9d47a1d50b
commit 9a2979efe5

View File

@@ -68,3 +68,16 @@ int freadln(char** output, size_t* length_out) {
errno = 0; errno = 0;
freadln_success_epilogue; 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