OSDN Git Service

Fix a potential macro expansion problem... isspace can be
authorEric Andersen <andersen@codepoet.org>
Sat, 15 Jun 2002 14:37:46 +0000 (14:37 -0000)
committerEric Andersen <andersen@codepoet.org>
Sat, 15 Jun 2002 14:37:46 +0000 (14:37 -0000)
a macro causing a double decrement...

coreutils/cal.c

index f6578bf..3ccd3ff 100644 (file)
@@ -372,7 +372,7 @@ void trim_trailing_spaces(char *s)
 
        for (p = s; *p; ++p)
                continue;
-       while (p > s && isspace(*--p))
+       while (p > s && (--p, isspace(*p)))
                continue;
        if (p > s)
                ++p;