[Crash-utility] [PATCH] trace: Improve "trace show" command

Dave Anderson anderson at redhat.com
Thu Mar 24 12:54:05 UTC 2011


----- Original Message -----
> On 03/23/2011 10:37 PM, Dave Anderson wrote:
> > So if you don't mind, I'll fix it like this:
> >
> >         buf[0] = 0;
> >         if ((file = popen(trace_cmd, "r"))) {
> >                 ret = fread(buf, 1, sizeof(buf), file);
> >                 buf[4095] = 0;
> >         }
> 
> It seems better:
> if (...) {
>         ret = fread(buf, 1, sizeof(buf) - 1, file);
>         buf[ret] = 0;
> }

Even better -- applied as above, and queued for crash-5.1.4.

Thanks Lai and Steve,
  Dave




More information about the Crash-utility mailing list