summaryrefslogtreecommitdiffstats
path: root/man3/getline.3
diff options
context:
space:
mode:
Diffstat (limited to 'man3/getline.3')
-rw-r--r--man3/getline.310
1 files changed, 5 insertions, 5 deletions
diff --git a/man3/getline.3 b/man3/getline.3
index b3e6ca4fe..b7835bedf 100644
--- a/man3/getline.3
+++ b/man3/getline.3
@@ -146,7 +146,7 @@ GNU, POSIX.1-2008.
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
-
+\&
int
main(int argc, char *argv[])
{
@@ -154,23 +154,23 @@ main(int argc, char *argv[])
char *line = NULL;
size_t len = 0;
ssize_t nread;
-
+\&
if (argc != 2) {
fprintf(stderr, "Usage: %s <file>\en", argv[0]);
exit(EXIT_FAILURE);
}
-
+\&
stream = fopen(argv[1], "r");
if (stream == NULL) {
perror("fopen");
exit(EXIT_FAILURE);
}
-
+\&
while ((nread = getline(&line, &len, stream)) != \-1) {
printf("Retrieved line of length %zd:\en", nread);
fwrite(line, nread, 1, stdout);
}
-
+\&
free(line);
fclose(stream);
exit(EXIT_SUCCESS);