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:
@@ -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
|
||||
|
Reference in New Issue
Block a user