summaryrefslogtreecommitdiffstats
path: root/src/util/profile/prof_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/profile/prof_parse.c')
-rw-r--r--src/util/profile/prof_parse.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/util/profile/prof_parse.c b/src/util/profile/prof_parse.c
index 844d66a57..019fabe25 100644
--- a/src/util/profile/prof_parse.c
+++ b/src/util/profile/prof_parse.c
@@ -32,15 +32,9 @@ static char *skip_over_blanks(cp)
static void strip_line(line)
char *line;
{
- char *p;
-
- while (*line) {
- p = line + strlen(line) - 1;
- if ((*p == '\n') || (*p == '\r'))
- *p = 0;
- else
- break;
- }
+ char *p = line + strlen(line);
+ while (p > line && (p[-1] == '\n' || p[-1] == '\r'))
+ *p-- = 0;
}
static void parse_quoted_string(char *str)