From c792f344bb3b25860ed650c4c134b72fdaac1d71 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 2 Nov 2014 10:42:24 +0100 Subject: [PATCH] inp_modify_exp(), cleanup #7/17, use postincrement --- src/frontend/inpcom.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 2ac42adff..3cb22bf25 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -5562,14 +5562,11 @@ inp_modify_exp(char* expr) if (((actchar == 'v') || (actchar == 'i')) && (str_ptr[1] == '(')) { while (*str_ptr != ')') { - buf[i] = *str_ptr; - i++; - str_ptr++; + buf[i++] = *str_ptr++; } - buf[i] = *str_ptr; + buf[i] = *str_ptr++; buf[i+1] = '\0'; wl->wl_word = copy(buf); - str_ptr++; } else { while (isalnum(*str_ptr) || (*str_ptr == '!') || (*str_ptr == '#') || @@ -5577,9 +5574,7 @@ inp_modify_exp(char* expr) (*str_ptr == '_') || (*str_ptr == '[') || (*str_ptr == ']')) { - buf[i] = *str_ptr; - i++; - str_ptr++; + buf[i++] = *str_ptr++; } buf[i] = '\0'; /* no parens {} around time, hertz, temper, the constants @@ -5625,10 +5620,9 @@ inp_modify_exp(char* expr) str_ptr++; } else { /* strange char */ printf("Preparing expression for numparam\nWhat is this?\n%s\n", str_ptr); - buf[0] = *str_ptr; + buf[0] = *str_ptr++; buf[1] = '\0'; wl->wl_word = copy(buf); - str_ptr++; } }