From: Jesper Juhl <juhl-lkml@dif.dk>
To: Roman Zippel <zippel@linux-m68k.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [patch] pedantic correctness cleanup for conf.c in scripts/kconfig/ .
Date: Wed, 5 Jan 2005 22:58:07 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.61.0501052250550.3492@dragon.hygekrogen.localhost> (raw)
In-Reply-To: <200501051326.56959.zippel@linux-m68k.org>
On Wed, 5 Jan 2005, Roman Zippel wrote:
> Hi,
>
> On Tuesday 04 January 2005 00:35, Jesper Juhl wrote:
>
> > @@ -305,8 +305,8 @@ static int conf_choice(struct menu *menu
> > printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
> > def_sym = sym_get_choice_value(sym);
> > cnt = def = 0;
> > - line[0] = '0';
> > - line[1] = 0;
> > + line[0] = '\0';
> > + line[1] = '\0';
> > for (child = menu->list; child; child = child->next) {
> > if (!menu_is_visible(child))
> > continue;
>
> This would make a difference and even the other change is not an improvement,
> 0 is special string marker and not a character.
>
You are right. that bit actually makes a difference, that was not my
intention but a silly error. I didn't spot it at the time for some reason
and the testing I did didn't show any behavioral differences so it slipped
through.
As to 0 vs \0 I know \0 ("the null character") has the value 0 (zero) so
the compiled code will be identical, but using \0 is IMO a good idea to
emphazise the character nature of it. But, I don't care greatly, I just
saw it and thought "ohh, why 0 and not the null char? Let's fix that up",
so I wrote a patch to make that change in case others agreed with me.
--
Jesper
prev parent reply other threads:[~2005-01-05 21:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-03 23:35 [patch] pedantic correctness cleanup for conf.c in scripts/kconfig/ Jesper Juhl
2005-01-05 12:26 ` Roman Zippel
2005-01-05 21:58 ` Jesper Juhl [this message]
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=Pine.LNX.4.61.0501052250550.3492@dragon.hygekrogen.localhost \
--to=juhl-lkml@dif.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=zippel@linux-m68k.org \
/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;
as well as URLs for NNTP newsgroup(s).