On Wed, Aug 31, 2011 at 10:11:49AM +0000, Denys Vlasenko wrote: > commit 5284557bfad96f12dd5798539008e1644f1dc094 > Author: Denys Vlasenko <[email protected]> > Date: Wed Aug 31 12:07:38 2011 +0200 > > Optimization: eliminate some usages of strcat() > > * defs.h: Declare stpcpy(). > * util.c: Define stpcpy(). > * file.c: Remove static str_append(). > (sprint_open_modes): Use stpcpy() instead of str_append(). > (sprintflags): Use stpcpy() instead of strcat(). > (printpathn): Eliminate usage of strcat(). > (printstr): Eliminate usage of strcat().
This is OK, but > --- a/defs.h > +++ b/defs.h > @@ -680,6 +680,13 @@ extern void tv_sub(struct timeval *, struct timeval *, > struct timeval *); > extern void tv_mul(struct timeval *, struct timeval *, int); > extern void tv_div(struct timeval *, struct timeval *, int); > > +/* Some libc have stpcpy, some don't. Sigh... > + * Roll our private implementation... > + */ > +#undef stpcpy > +#define stpcpy strace_stpcpy > +extern char *stpcpy(char *dst, const char *src); > + I'd rather add stpcpy to AC_CHECK_FUNCS, to use stpcpy() from libc if the latter provides stpcpy(). -- ldv
pgpFd252iSyd6.pgp
Description: PGP signature
------------------------------------------------------------------------------ Special Offer -- Download ArcSight Logger for FREE! Finally, a world-class log management solution at an even better price-free! And you'll get a free "Love Thy Logs" t-shirt when you download Logger. Secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________ Strace-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/strace-devel
