Re: [PATCH v3] add u64 number parser

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

 



On Sat, Sep 24, 2016 at 8:27 AM, James Smart <james.smart@xxxxxxxxxxxx> wrote:
>
> add u64 number parser
>
> Prior patch revised to use kasprintf.
> Modified match_number to use kasprintf as well

Why would you do this? It's insane. kasprintf() is not the right thing
at all to use for anything like this. It appears that you want to use
strncpy() or something. Or you could just avoid the extra copy
entirely in 99% of all cases and just use simple_strtol() and check
that the end didn't overflow the substring, which it presumably never
does anyway.

Yes, the stupid code is already disgustingly bad. But let's not make
it *worse*, for chrissake!

               Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux