lkml.org 
[lkml]   [2005]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] pedantic correctness cleanup for conf.c in scripts/kconfig/ .
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


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.132 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site