mirror of
https://gitlab.com/80486DX2-66/gists
synced 2025-01-26 18:21:53 +05:30
freadln.c: add a test
This commit is contained in:
parent
9d47a1d50b
commit
9a2979efe5
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user