← Back to team overview

rohc team mailing list archive

Re: Optimisation: less strlen() calls

 

Hello,

>   Functions printf(), sprintf(), vsprintf() return the number of 
> characters copied into the buffer. So, it is not useful to call
> strlen() after calling one of these functions.
> 
>   So, I replace code like:
> 
>   sprintf(buffer,"sjmlsdj %x sdfsj",ddfff);
>   buffer += strlen(buffer);
> 
> with:
> 
>   buffer += sprintf(buffer,"sjmlsdj %x sdfsj",ddfff);
> 
>   Attached is a file patch for current branch.

Thank you for the patch!

Applied on trunk:
http://bazaar.launchpad.net/~didier-barvaux/rohc/main/revision/377

Regards,
Didier

Attachment: signature.asc
Description: PGP signature


References