From 5425ce387ecb57c5d029aea72e55d95c2c5bec45 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 29 May 2013 22:50:23 +0200 Subject: [PATCH] inpcom.c, improve readability of skip_back_non_ws() and skip_back_ws() --- src/frontend/inpcom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index cbf8ad6de..56faf56a5 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -109,8 +109,8 @@ static char *get_quoted_token(char *string, char **token); static void replace_token(char *string, char *token, int where, int total); static void inp_add_series_resistor(struct line *deck); -static char *skip_back_non_ws(char *d) { --d; while (*d && !isspace(*d)) d--; return d + 1; } -static char *skip_back_ws(char *d) { --d; while (isspace(*d)) d--; return d + 1; } +static char *skip_back_non_ws(char *d) { while (d[-1] && !isspace(d[-1])) d--; return d; } +static char *skip_back_ws(char *d) { while (isspace(d[-1])) d--; return d; } static char *skip_non_ws(char *d) { while (*d && !isspace(*d)) d++; return d; } static char *skip_ws(char *d) { while (isspace(*d)) d++; return d; }