bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/8] Avoid hashing garbage for short keynames.


From: Diego Nieto Cid
Subject: Re: [PATCH 2/8] Avoid hashing garbage for short keynames.
Date: Wed, 11 Aug 2010 19:04:17 -0300

Hi,

2010/8/9  <olafBuddenhagen@gmx.net>:
>
> Hm, why tmp[5]? The way I read the code, only 4 entries are used...
>

Well it's the null that terminates the string. But as this isn't used
as a string it probably does not make much sense.

> BTW, minor stylistic nitpick: I generally consider it clearer and more
> robust to use sizeof in strncpy(), i.e.:
>
>   strncpy(tmp, keyname, sizeof tmp)
>
> But that's only matter of style -- so if you prefer your variant,
> feel free to keep it like that :-)
>

It's alway good to remove hardcoded constants. :)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]