[Toybox] [PATCH] getline() returns -1 on EOF, not 0.
Rob Landley
rob at landley.net
Sat Sep 25 09:30:52 PDT 2021
On 9/24/21 6:51 PM, enh via Toybox wrote:
> ...but you can get 0 if you have a "no newline at end of file" file.
>
> I've been through all the current callers, and just these ones weren't
> using the canonical test.
> ---
> toys/lsb/mount.c | 2 +-
> toys/pending/init.c | 2 +-
> toys/pending/lsof.c | 2 +-
> toys/pending/userdel.c | 2 +-
The last three are in pending for a reason, but the mount one is a facepalm.
Good catch,
Rob
More information about the Toybox
mailing list