mirror of
https://gitlab.com/80486DX2-66/gists
synced 2024-12-27 05:40:17 +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;
|
||||
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…
Reference in New Issue
Block a user