diff --git a/lang/cem/cpp.ansi/domacro.c b/lang/cem/cpp.ansi/domacro.c index 99d906349..9cd92f8ca 100644 --- a/lang/cem/cpp.ansi/domacro.c +++ b/lang/cem/cpp.ansi/domacro.c @@ -304,6 +304,7 @@ do_include() error("cannot open include file \"%s\"", filenm); } else { + if (filenm != result) free(filenm); WorkingDir = getwdir(result); svnestlevel[++nestcount] = nestlevel; FileName = result; diff --git a/lang/cem/cpp.ansi/preprocess.c b/lang/cem/cpp.ansi/preprocess.c index ea6b62cd8..1a31034ab 100644 --- a/lang/cem/cpp.ansi/preprocess.c +++ b/lang/cem/cpp.ansi/preprocess.c @@ -159,7 +159,7 @@ preprocess(fn) if (c == '*') { op = SkipComment(op, &lineno); if (!op) return; - if (!options['C']) echo(' '); + if (!options['C']) { echo(' '); } c = GetChar(); continue; } @@ -198,7 +198,7 @@ preprocess(fn) if (c == '*') { op = SkipComment(op, &lineno); if (!op) return; - if (!options['C']) echo(' '); + if (!options['C']) { echo(' '); } c = GetChar(); continue; } @@ -264,7 +264,7 @@ preprocess(fn) continue; } else if (!is_dig(c)) { continue; - } else echo(c); + } else { echo(c); } } c = GetChar(); while (in_idf(c) || c == '.') { @@ -338,7 +338,7 @@ preprocess(fn) echo(*tg++); } c = GetChar(); - if (in_idf(c)) echo(' '); + if (in_idf(c)) { echo(' '); } continue; } nomac: diff --git a/lang/cem/cpp.ansi/replace.c b/lang/cem/cpp.ansi/replace.c index 76394d55a..487d86d15 100644 --- a/lang/cem/cpp.ansi/replace.c +++ b/lang/cem/cpp.ansi/replace.c @@ -65,8 +65,8 @@ freeargs(args) /* We must don't know how many parameters were specified, so be * prepared to free all NPARAMS parameters. - * When an expvec is !0, the rawvec will also be !0. - * When an expvec is 0, all remaining vectors will also be 0. + * When an expvec is !NULL, the rawvec will also be !NULL. + * When an expvec is NULL, all remaining vectors will also be NULL. */ for (i = 0; i < NPARAMS; i++) { if (args->a_expvec[i]) {