mirror of
https://gitlab.com/80486DX2-66/gists
synced 2025-04-13 05:59:06 +05:30
freadln.c: test: make use of length_out
This commit is contained in:
parent
2e294a2047
commit
39de2a67d8
@ -135,12 +135,13 @@ int main(void) {
|
||||
// stdin test
|
||||
printf("Type something> ");
|
||||
char* line;
|
||||
if (finreadln(&line, NULL) == freadln_ERROR) {
|
||||
size_t line_length = 0;
|
||||
if (finreadln(&line, &line_length) == freadln_ERROR) {
|
||||
perror("freadln");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
printf("Input string: '%s' (%" PRIuSIZE " characters)\n", line,
|
||||
(SIZE_T_FORMAT) strlen(line));
|
||||
(SIZE_T_FORMAT) line_length);
|
||||
|
||||
// file test
|
||||
#define TEST_FILE "freadln_test.txt"
|
||||
|
Loading…
x
Reference in New Issue
Block a user