From: Geoff Levand <geoffrey.levand@am•sony.com>
To: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom•com>
Cc: "linuxppc-dev@ozlabs•org" <linuxppc-dev@ozlabs•org>,
Paul Mackerras <paulus@samba•org>
Subject: Re: [patch v3] PS3: Fix printing of os-area magic numbers
Date: Sun, 23 Dec 2007 09:20:15 -0800 [thread overview]
Message-ID: <476E98CF.7010204@am.sony.com> (raw)
In-Reply-To: <Pine.LNX.4.62.0712231049240.17187@chinchilla.sonytel.be>
On 12/23/2007 01:51 AM, Geert Uytterhoeven wrote:
> On Sat, 22 Dec 2007, Geoff Levand wrote:
>> +static void dump_field(char *s, const u8 *f, unsigned int size)
>> +{
>> +#if defined(DEBUG)
>> + unsigned int i;
>> +
>> + for (i = 0; i < size; i++)
>> + s[i] = isprint(f[i]) ? f[i] : '.';
>> + s[i] = 0;
>> +#endif
>> +}
>
> Sorry for nitpicking again.
>
> Usually the _length_ of a C-string is the number of characters, while the
> _size_ of a C-string includes the zero-terminator.
>
> In dump_field() it writes size+1 bytes to s.
The arg size is the size of the field in bytes:
dump_field(str, h->magic_num, sizeof(h->magic_num));
To me, the name length doesn't seem to convey that.
-Geoff
next prev parent reply other threads:[~2007-12-23 17:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-17 22:24 [patch] PS3: Fix printing of os-area magic numbers Geoff Levand
2007-11-18 9:33 ` Geert Uytterhoeven
2007-11-22 22:08 ` [patch v2] " Geoff Levand
2007-12-21 4:44 ` Paul Mackerras
2007-12-23 4:54 ` Geoff Levand
2007-12-23 5:09 ` [patch v3] " Geoff Levand
2007-12-23 9:51 ` Geert Uytterhoeven
2007-12-23 17:20 ` Geoff Levand [this message]
2007-12-23 17:41 ` [patch v4] " Geoff Levand
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=476E98CF.7010204@am.sony.com \
--to=geoffrey.levand@am$(echo .)sony.com \
--cc=Geert.Uytterhoeven@sonycom$(echo .)com \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=paulus@samba$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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