summaryrefslogtreecommitdiff
path: root/stream.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2012-01-20 11:04:04 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2012-01-20 11:04:04 +0100
commita1d541ec56e2fb4716f083fcc814b1dedde63d87 (patch)
treedd93ffd232792fac178a1de6bf646c099bdbdc49 /stream.c
parentb3c52cf02ae536634898cd12afa5f3fcad17fbf2 (diff)
downloadstrace-a1d541ec56e2fb4716f083fcc814b1dedde63d87.tar.gz
strace-a1d541ec56e2fb4716f083fcc814b1dedde63d87.tar.bz2
strace-a1d541ec56e2fb4716f083fcc814b1dedde63d87.tar.xz
Eliminate code duplication in time printing, reduce a few static buffers
text data bss dec hex filename 238454 664 28772 267890 41672 strace.before 238106 664 28676 267446 414b6 strace * defs.h: Add TIMESPEC_TEXT_BUFSIZE and TIMEVAL_TEXT_BUFSIZE defines. Add 'int special' parameter to sprinttv(). * time.c (sprinttv): Add 'int special' parameter, and use it similarly to 'int special' parameter of printtv_bitness(). (printtv_bitness): Use sprinttv() instead of duplicating its code. (print_timespec): Use sprint_timespec() instead of duplicating its code. * desc.c (decode_select): Use TIMEVAL_TEXT_BUFSIZE instead of 128 when checking remaining buffer size. * net.c (sys_recvmsg): Use TIMESPEC_TEXT_BUFSIZE instead of 128 for static buffer size. * stream.c (decode_poll): Use TIMESPEC_TEXT_BUFSIZE instead of 128 when checking remaining buffer size. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stream.c b/stream.c
index 56f07c6..d946b22 100644
--- a/stream.c
+++ b/stream.c
@@ -404,7 +404,7 @@ decode_poll(struct tcb *tcp, long pts)
*outptr = '\0';
if (pts) {
- if (outptr < end_outstr - 128) {
+ if (outptr < end_outstr - (10 + TIMESPEC_TEXT_BUFSIZE)) {
outptr = stpcpy(outptr, outptr == outstr ? "left " : ", left ");
sprint_timespec(outptr, tcp, pts);
}