1
0
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:
2025-03-02 14:06:42 +03:00
parent 2e294a2047
commit 39de2a67d8

View File

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