ps output redirection problem

Ignacio García Pérez iggarpe at terra.es
Fri Mar 30 07:55:56 UTC 2007


>> IMHO my fix is better.
>>     
>
> -       printf("%.*s\n", terminal_width, buffer);
> +       if (terminal_width < buffer_width) buffer[terminal_width] = 0;
> +       printf("%s\n", buffer);
>   
I was expecting such a reply :-)

I noticed it's bigger, but come on, it may translate to about a dozen 
bytes of code, which would be 10 if we substract the ".*" we are saving. 
10 bytes should be less than 1% of the total ps code size.

Is that 1% worth a less robust code?

(robust against different libc particularities, I mean)

Regards.



More information about the busybox mailing list