aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/strbuf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c
index 2eeb51baf077..cfa906882e2c 100644
--- a/tools/perf/util/strbuf.c
+++ b/tools/perf/util/strbuf.c
@@ -90,17 +90,17 @@ void strbuf_addf(struct strbuf *sb, const char *fmt, ...)
90 if (!strbuf_avail(sb)) 90 if (!strbuf_avail(sb))
91 strbuf_grow(sb, 64); 91 strbuf_grow(sb, 64);
92 va_start(ap, fmt); 92 va_start(ap, fmt);
93 len = vscnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap); 93 len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap);
94 va_end(ap); 94 va_end(ap);
95 if (len < 0) 95 if (len < 0)
96 die("your vscnprintf is broken"); 96 die("your vsnprintf is broken");
97 if (len > strbuf_avail(sb)) { 97 if (len > strbuf_avail(sb)) {
98 strbuf_grow(sb, len); 98 strbuf_grow(sb, len);
99 va_start(ap, fmt); 99 va_start(ap, fmt);
100 len = vscnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap); 100 len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap);
101 va_end(ap); 101 va_end(ap);
102 if (len > strbuf_avail(sb)) { 102 if (len > strbuf_avail(sb)) {
103 die("this should not happen, your snprintf is broken"); 103 die("this should not happen, your vsnprintf is broken");
104 } 104 }
105 } 105 }
106 strbuf_setlen(sb, sb->len + len); 106 strbuf_setlen(sb, sb->len + len);