Re: [PATCH 3/3] exterminate strtok - usr/gen_init_cpio.c

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

 



Horst wrote:
> > -		if ('\n' == *type) {
> > +		if (!*type || '\n' == *type) {
> 
> Redundant. If *type == '\n', it is certainly != 0.

No - I don't think redundant, at least not this change in isolation.
Perhaps redundant in light of subsequent code lines, as Jesper notes in
his followup.

But it is confusing to read - poor and inconsistent choice of code
phrasing.

If the patch had read as:
    -		if (*type == '\n') {
    +		if (*type == '\n' || *type == '\0') {

then it would be clearer to the reader in my view.  A check for newline
is changed to a check for newline or nul-byte.

(Yes - I recognize that one is not given the freedom to change the
-old- lines in a patch for the sake of clarity ;).

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <[email protected]> 1.925.600.0401
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux