diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-08-31 12:07:38 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-08-31 12:07:38 +0200 |
commit | 5284557bfad96f12dd5798539008e1644f1dc094 (patch) | |
tree | e21f2606f12499b00031a2ce49e9b467cf3b287e /defs.h | |
parent | b5b2589231847905229d78588316e708cbd03af1 (diff) | |
download | strace-5284557bfad96f12dd5798539008e1644f1dc094.tar.gz strace-5284557bfad96f12dd5798539008e1644f1dc094.tar.bz2 strace-5284557bfad96f12dd5798539008e1644f1dc094.tar.xz |
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().
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'defs.h')
-rw-r--r-- | defs.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); + #ifdef SUNOS4 extern int fixvfork(struct tcb *); #endif |