[procps] Re: stat2proc issue

  • From: Jim Warner <james.warner@xxxxxxxxxxx>
  • To: procps@xxxxxxxxxxxxx
  • Date: Fri, 24 Aug 2012 07:43:44 -0500

On Fri, 2012-08-24 at 07:30 -0400, Jaromir Capik wrote:
> Hi everyone.
> 
> I recently found a strange piece of code in stat2proc
> function located in the proc/readproc.c source file.
> There's a sscanf function having 39 format alements,
> but only 33 argument elements. It seems that 6 of them
> were commented out, but the format string remained
> untouched. So ... it's pretty possible, that some
> of the fields have a wrong format specifier due
> to the shift caused by commenting some arguments out.
> 
> Does anybody know why it's like that?
> 
> Thanks,
> Jaromir.


Hi Jaromir,

You forget to subtract the 6 placeholders.
(the '*' assignment-suppression specifiers)

Regards,
Jim



Other related posts: