From 3acf7914095f3e695f77bee07345ab2983370aae Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Fri, 1 Jul 2016 10:56:46 +0200 Subject: [PATCH] make docu for %r converer more specific about %.2r versus %2r --- doc/formats.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/formats.html b/doc/formats.html index b2e97c4..5fdf49a 100644 --- a/doc/formats.html +++ b/doc/formats.html @@ -370,6 +370,9 @@ With the 0 flag, the value is unsigned, otherwise signed. In output, the precision (or sizeof(long) whatever is less) least significant bytes of the value are sign extended or zero extended (depending on the 0 flag) to width bytes. +The default for precision is 1. Thus if you do not specify +the precision, only the least significant byte is written! +It is common error to write out "%2r"; instead of out "%.2r";.

In input, width bytes are read and put into the value. @@ -380,7 +383,7 @@ the value is sign extended or zero extended, depending on the 0 flag.

-Example: out "%.2r" +Examples: out "%.2r"; in "%02r";