bin/145748: hexdump(1) %s format qualifier broken

Garrett Cooper yanegomi at gmail.com
Fri Apr 16 19:00:12 UTC 2010


The following reply was made to PR bin/145748; it has been noted by GNATS.

From: Garrett Cooper <yanegomi at gmail.com>
To: bug-followup at freebsd.org
Cc:  
Subject: Re: bin/145748: hexdump(1) %s format qualifier broken
Date: Fri, 16 Apr 2010 11:58:34 -0700

 --Apple-Mail-1--1068145528
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/plain;
 	charset=us-ascii
 
 Begin forwarded message:
 
 > From: Bruce Evans <brde at optusnet.com.au>
 > Date: April 16, 2010 4:25:01 AM PDT
 > To: Garrett Cooper <gcooper at FreeBSD.org>
 > Subject: Re: bin/145748: hexdump(1) %s format qualifier broken
 >=20
 >>> Description:
 >> According to the manpage...
 >>=20
 >>          o   A byte count or field precision is required for each =
 ``s'' con-
 >>              version character (unlike the fprintf(3) default which =
 prints
 >>              the entire string if the precision is unspecified).
 >>=20
 >> .. this should just work. It doesn't however:
 >>=20
 >> $ echo "$(jot -b a 1024)" | hexdump  -e '"%4s\n"'
 >> hexdump: %s: requires a precision or a byte count
 >>> How-To-Repeat:
 >> echo "$(jot -b a 1024)" | hexdump  -e '"%4s\n"'
 >=20
 > "4" in %4s" is the field width.  "%.4s" has precision 4 and is =
 accepted,
 > but I don't know what most of this is supposed to do so I don't know =
 if
 > this actually works.
 
 For future reference...
 -Garrett=
 
 --Apple-Mail-1--1068145528
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/html;
 	charset=us-ascii
 
 <html><head></head><body style=3D"word-wrap: break-word; =
 -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; =
 "><div><div>Begin forwarded message:</div><br =
 class=3D"Apple-interchange-newline"><blockquote type=3D"cite"><div =
 style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
 margin-left: 0px;"><span style=3D"font-family:'Helvetica'; =
 font-size:medium; color:rgba(0, 0, 0, 1);"><b>From: </b></span><span =
 style=3D"font-family:'Helvetica'; font-size:medium;">Bruce Evans &lt;<a =
 href=3D"mailto:brde at optusnet.com.au">brde at optusnet.com.au</a>&gt;<br></spa=
 n></div><div style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: =
 0px; margin-left: 0px;"><span style=3D"font-family:'Helvetica'; =
 font-size:medium; color:rgba(0, 0, 0, 1);"><b>Date: </b></span><span =
 style=3D"font-family:'Helvetica'; font-size:medium;">April 16, 2010 =
 4:25:01 AM PDT<br></span></div><div style=3D"margin-top: 0px; =
 margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span =
 style=3D"font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, =
 1);"><b>To: </b></span><span style=3D"font-family:'Helvetica'; =
 font-size:medium;">Garrett Cooper &lt;<a =
 href=3D"mailto:gcooper at FreeBSD.org">gcooper at FreeBSD.org</a>&gt;<br></span>=
 </div><div style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: =
 0px; margin-left: 0px;"><span style=3D"font-family:'Helvetica'; =
 font-size:medium; color:rgba(0, 0, 0, 1);"><b>Subject: </b></span><span =
 style=3D"font-family:'Helvetica'; font-size:medium;"><b>Re: bin/145748: =
 hexdump(1) %s format qualifier =
 broken</b><br></span></div><br><div><blockquote type=3D"cite"><blockquote =
 type=3D"cite">Description:<br></blockquote></blockquote><blockquote =
 type=3D"cite">According to the manpage...<br></blockquote><blockquote =
 type=3D"cite"><br></blockquote><blockquote type=3D"cite"> =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o &nbsp;&nbsp;A =
 byte count or field precision is required for each ``s'' =
 con-<br></blockquote><blockquote type=3D"cite"> =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
 bsp;version character (unlike the fprintf(3) default which =
 prints<br></blockquote><blockquote type=3D"cite"> =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
 bsp;the entire string if the precision is =
 unspecified).<br></blockquote><blockquote =
 type=3D"cite"><br></blockquote><blockquote type=3D"cite">.. this should =
 just work. It doesn't however:<br></blockquote><blockquote =
 type=3D"cite"><br></blockquote><blockquote type=3D"cite">$ echo "$(jot =
 -b a 1024)" | hexdump &nbsp;-e '"%4s\n"'<br></blockquote><blockquote =
 type=3D"cite">hexdump: %s: requires a precision or a byte =
 count<br></blockquote><blockquote type=3D"cite"><blockquote =
 type=3D"cite">How-To-Repeat:<br></blockquote></blockquote><blockquote =
 type=3D"cite">echo "$(jot -b a 1024)" | hexdump &nbsp;-e =
 '"%4s\n"'<br></blockquote><br>"4" in %4s" is the field width. =
 &nbsp;"%.4s" has precision 4 and is accepted,<br>but I don't know what =
 most of this is supposed to do so I don't know if<br>this actually =
 works.</div></blockquote></div><br><div>For future =
 reference...</div><div>-Garrett</div></body></html>=
 
 --Apple-Mail-1--1068145528--


More information about the freebsd-bugs mailing list