[PATCH] elfclassify tool
Mark Wielaard
mark@klomp.org
Tue Aug 13 09:44:00 GMT 2019
On Mon, Jul 29, 2019 at 04:38:17PM +0200, Florian Weimer wrote:
> > On Mon, Jul 29, 2019 at 11:16:31AM +0200, Florian Weimer wrote:
> > So the test should be:
> >
> > diff --git a/src/elfclassify.c b/src/elfclassify.c
> > index ebd42c1d5..b17d14d45 100644
> > --- a/src/elfclassify.c
> > +++ b/src/elfclassify.c
> > @@ -862,7 +862,7 @@ process_stdin (int *status)
> > break;
> > if (ret < 0)
> > abort (); /* Cannot happen due to error checks above. */
> > - if (delim != '\0' && ret > 0)
> > + if (delim != '\0' && ret > 0 && buffer[ret - 1] == '\n')
> > buffer[ret - 1] = '\0';
> > current_path = buffer;
> > process_current_path (status);
>
> Right. But now I wonder why ret == 0 can ever happen. Maybe on
> OpenVMS, which doesn't use in-band signaling for line terminators?
I also couldn't create a situation where ret == 0.
But I still included the change because it feels more robust.
Thanks,
Mark
More information about the Elfutils-devel
mailing list