1
0
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:
パチュリー・ノーレッジ 2025-03-02 14:06:42 +03:00
parent 2e294a2047
commit 39de2a67d8
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

@ -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"