libbb/trim.c

Bernhard Fischer rep.dot.nop at gmail.com
Wed Jun 13 22:49:52 UTC 2007


On Thu, Jun 14, 2007 at 12:29:55AM +0200, souf wrote:
>I tried to rewrite libbb/trim.c by adding new functions, a similar
>functions are dispersed in busybox:
>coreutils/cal.c
>miscutils/crond.c
>procps/sysctl.c
>shell/lash.c
>shell/ash.c
>applets/applets.c
>
>trim.c =========================================================
>#include "libbb.h"
>
>char *bb_strtrim(char *s, int c)

c can be const here.
>{
>	char *t = NULL;
>
>	if (!s) return NULL;

It is most likely smaller if you initialize t to NULL after checking s.

[snip]
>I do not know if it is interesting or not ?

Depends. What's the size(1) and make bloatcheck output for a couple of
different versions of gcc?

cheers,



More information about the busybox mailing list