fixed small bug
authoreck <none@none>
Mon, 27 Nov 1989 11:40:58 +0000 (11:40 +0000)
committereck <none@none>
Mon, 27 Nov 1989 11:40:58 +0000 (11:40 +0000)
lang/cem/cpp.ansi/domacro.c
lang/cem/cpp.ansi/replace.c

index da5f519..012b936 100644 (file)
@@ -639,6 +639,7 @@ get_text(formals, length)
        c = GetChar();
 
        repl->r_ptr = repl->r_text = Malloc(repl->r_size = ITEXTSIZE);
+       *repl->r_ptr = '\0';
        while ((c != EOI) && (class(c) != STNL)) {
                if (BLANK(c)) {
                        if (!blank++) add2repl(repl, ' ');
index 418f8e7..5b2719c 100644 (file)
@@ -537,6 +537,7 @@ macro2buffer(repl, idf, args)
        int err = 0;
        char *stringify();
 
+       assert(ptr[idf->id_macro->mc_length] == '\0');
        while (*ptr) {
            if (*ptr == '\'' || *ptr == '"') {
                register int delim = *ptr;