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