Skip to contentSkip to conversation

getline.3: Use %zd rather than %zu when printing 'ssize_t' values

PATCH In review Alejandro Colomar 2 participants 2 messages Sep 7, 2020 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 getline.3: Use %zd rather than %zu when printing 'ssize_t' values

---
 man3/getline.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man3/getline.3 +1 -1
index 0dc3a562d..8cd974c05 100644
@@ -184,7 +184,7 @@ main(int argc, char *argv[])
     }
 
     while ((nread = getline(&line, &len, stream)) != \-1) {
-        printf("Retrieved line of length %zu:\en", nread);
+        printf("Retrieved line of length %zd:\en", nread);
         fwrite(line, nread, 1, stdout);
     }
 
Signature · 1 line
2.28.0
#1 lore raw
Quoted 4 lines · Alejandro Colomar
---
 man3/getline.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, Alex. Patch applied.

Cheers,

Michael

Quoted 14 lines
man3/getline.3 +1 -1
index 0dc3a562d..8cd974c05 100644
@@ -184,7 +184,7 @@ main(int argc, char *argv[])
     }
 
     while ((nread = getline(&line, &len, stream)) != \-1) {
-        printf("Retrieved line of length %zu:\en", nread);
+        printf("Retrieved line of length %zd:\en", nread);
         fwrite(line, nread, 1, stdout);
     }
 
Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/