From: E Robertson <e.robertson.svg@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] sprintf side effect, a bug?
Date: Mon, 26 Jan 2009 14:53:05 -0600 [thread overview]
Message-ID: <200901261453.10434.e.robertson.svg@gmail.com> (raw)
Hi,
It seems that sprintf() is modifying at least two bytes from the source and I
have duplicate this with different varibles.
For instance, I have a mac address defined as unsigned char [6]:
Doing the following sets the environment variable correctly, however bytes [0]
and [1], are modified at the source.
sprintf(env_ethaddr,"%02X:%02X:%02X:%02X:%02X:%02X", MACAddress[0],
MACAddress[1],
MACAddress[2], MACAddress[3],
MACAddress[4], MACAddress[5]);
Has anyone noticed this before?
I don't think the machine matters but I am building for an arm at91.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090126/68e825fd/attachment.pgp
next reply other threads:[~2009-01-26 20:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-26 20:53 E Robertson [this message]
2009-01-26 22:30 ` [U-Boot] sprintf side effect, a bug? Wolfgang Denk
2009-01-27 20:19 ` E Robertson
2009-01-27 20:31 ` Scott Wood
2009-01-27 20:57 ` E Robertson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200901261453.10434.e.robertson.svg@gmail.com \
--to=e.robertson.svg@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox