[File] Don't count `\0` in string length

Avinash Sonawane rootkea at gmail.com
Fri Dec 10 23:50:35 UTC 2021


Hello!

At present, we count `\0` byte in string length for `desired_len` but
not for `result_len` (uses strlen).

So, on current master currently for every successful test `desired_len =
result_len + 1` but since we make comparison using strcmp we don't see
it (for successful test).

This patch correctly ignores `\0` while calculating `desired_len`.

Thanks!

Regards,
Avinash Sonawane (rootKea)
https://www.rootkea.me
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Don-t-count-0-in-string-length.patch
Type: text/x-patch
Size: 611 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20211211/7fda54ef/attachment.bin>


More information about the File mailing list