diff --git a/lib/fields.c b/lib/fields.c index fa5fd156..640be931 100644 --- a/lib/fields.c +++ b/lib/fields.c @@ -91,8 +91,9 @@ void change_field (char *buf, size_t maxsize, const char *prompt) * entering a space. --marekm */ - while (--cp >= newf && isspace (*cp)); - cp++; + while (newf < cp && isspace (cp[-1])) { + cp--; + } *cp = '\0'; cp = newf;