lkml.org 
[lkml]   [2015]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/4] perf, tools: Do not include escape sequences in color_vfprintf return
Date
From: Andi Kleen <ak@linux.intel.com>

color_vprintf was including the length of the invisible escape
sequences in its return argument. Don't include them to make
the return value usable for indentation calculations.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
tools/perf/util/color.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/color.c b/tools/perf/util/color.c
index 55355b3..f3d1d6d 100644
--- a/tools/perf/util/color.c
+++ b/tools/perf/util/color.c
@@ -83,12 +83,12 @@ static int __color_vfprintf(FILE *fp, const char *color, const char *fmt,
}

if (perf_use_color_default && *color)
- r += fprintf(fp, "%s", color);
+ fprintf(fp, "%s", color);
r += vfprintf(fp, fmt, args);
if (perf_use_color_default && *color)
- r += fprintf(fp, "%s", PERF_COLOR_RESET);
+ fprintf(fp, "%s", PERF_COLOR_RESET);
if (trail)
- r += fprintf(fp, "%s", trail);
+ fprintf(fp, "%s", trail);
return r;
}

--
2.4.3


\
 
 \ /
  Last update: 2015-07-30 07:21    [W:0.113 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site