Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #123554
| Path | csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | "Pascal J. Bourguignon" <pjb@informatimago.com> |
| Newsgroups | comp.lang.c |
| Subject | Re: Updating pointer with result of sprintf |
| Date | Tue, 28 Nov 2017 12:47:41 +0100 |
| Organization | Informatimago |
| Lines | 20 |
| Message-ID | <m2zi76bp5u.fsf@informatimago.com> (permalink) |
| References | <ovjd76$sbt$1@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| X-Trace | individual.net OTPQnc75D+svgq12oLJaQgmXbuLIh14mwusASd1gcXBOpLplXZ |
| Cancel-Lock | sha1:ODE5MTlhMmNlYjNjNDU4OTg1YTI2YTcwMWY3NmQ4ZjU0NjFjMDFlMA== sha1:VqMwaNn83xoxZn2dJKIITCjdRhE= |
| Face | iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== |
| X-Accept-Language | fr, es, en |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/25.1 (darwin) |
| Xref | csiph.com comp.lang.c:123554 |
Show key headers only | View raw
Noob <root@127.0.0.1> writes:
> Hello,
>
> Consider the following code:
>
> unsigned char src[32]; /* initialized somewhere */
> char buf[65];
>
> for (i = 0; i < sizeof src; ++i)
> buf += sprintf(buf, "%02x", src[i]);
In addition to the other answers, it's also missing:
buf[64]=0;
--
__Pascal J. Bourguignon
http://www.informatimago.com
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar
Updating pointer with result of sprintf Noob <root@127.0.0.1> - 2017-11-28 11:19 +0100
Re: Updating pointer with result of sprintf bartc <bc@freeuk.com> - 2017-11-28 11:02 +0000
Re: Updating pointer with result of sprintf jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-28 12:09 +0100
Re: Updating pointer with result of sprintf Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-11-28 11:23 +0000
Re: Updating pointer with result of sprintf Keith Thompson <kst-u@mib.org> - 2017-11-28 08:58 -0800
Re: Updating pointer with result of sprintf Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-11-28 11:10 +0000
Re: Updating pointer with result of sprintf Spiros Bousbouras <spibou@gmail.com> - 2017-11-28 16:51 +0000
Re: Updating pointer with result of sprintf Keith Thompson <kst-u@mib.org> - 2017-11-28 09:24 -0800
Re: Updating pointer with result of sprintf Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-11-29 00:33 +0000
Re: Updating pointer with result of sprintf Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-11-29 00:36 +0000
Re: Updating pointer with result of sprintf Spiros Bousbouras <spibou@gmail.com> - 2017-11-29 19:04 +0000
Re: Updating pointer with result of sprintf "Pascal J. Bourguignon" <pjb@informatimago.com> - 2017-11-28 12:47 +0100
Re: Updating pointer with result of sprintf "Pascal J. Bourguignon" <pjb@informatimago.com> - 2017-11-28 12:49 +0100
Re: Updating pointer with result of sprintf scott@slp53.sl.home (Scott Lurndal) - 2017-11-28 14:19 +0000
Re: Updating pointer with result of sprintf gazelle@shell.xmission.com (Kenny McCormack) - 2017-11-28 14:27 +0000
Re: Updating pointer with result of sprintf Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-11-28 14:35 +0000
Re: Updating pointer with result of sprintf "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-11-28 06:31 -0800
Re: Updating pointer with result of sprintf "Pascal J. Bourguignon" <pjb@informatimago.com> - 2017-11-28 15:51 +0100
Re: Updating pointer with result of sprintf "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-11-28 07:23 -0800
Re: Updating pointer with result of sprintf "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-11-28 08:16 -0800
Re: Updating pointer with result of sprintf Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-11-28 16:32 +0000
Re: Updating pointer with result of sprintf "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-11-28 08:57 -0800
Re: Updating pointer with result of sprintf "Pascal J. Bourguignon" <pjb@informatimago.com> - 2017-11-29 00:47 +0100
Re: Updating pointer with result of sprintf "Pascal J. Bourguignon" <pjb@informatimago.com> - 2017-11-29 00:45 +0100
Re: Updating pointer with result of sprintf Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-11-28 16:22 +0000
Re: Updating pointer with result of sprintf Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-11-28 16:25 +0000
Re: Updating pointer with result of sprintf "Pascal J. Bourguignon" <pjb@informatimago.com> - 2017-11-29 00:48 +0100
Re: Updating pointer with result of sprintf Noob <root@127.0.0.1> - 2017-11-29 10:07 +0100
Re: Updating pointer with result of sprintf Barry Schwarz <schwarzb@dqel.com> - 2017-11-29 09:18 -0800
csiph-web