added missing parens in buffer allocation (caused seg violation)
authorAndrew Moore <alm@FreeBSD.org>
Fri, 2 Jul 1993 10:55:17 +0000 (10:55 +0000)
committerAndrew Moore <alm@FreeBSD.org>
Fri, 2 Jul 1993 10:55:17 +0000 (10:55 +0000)
usr.bin/sed/process.c

index 75b08dc..014a059 100644 (file)
@@ -564,7 +564,8 @@ cspace(sp, p, len, spflag)
         * need two extra bytes, one for the newline, one for a terminating
         * NULL.
         */
         * need two extra bytes, one for the newline, one for a terminating
         * NULL.
         */
-       tlen = sp->len + len + spflag == APPENDNL ? 2 : 1;
+/*     tlen = sp->len + len + spflag == APPENDNL ? 2 : 1; */
+       tlen = sp->len + len + (spflag == APPENDNL ? 2 : 1);  /* XXX */
        if (tlen > sp->blen) {
                sp->blen = tlen + 1024;
                sp->space = sp->back = xrealloc(sp->back, sp->blen);
        if (tlen > sp->blen) {
                sp->blen = tlen + 1024;
                sp->space = sp->back = xrealloc(sp->back, sp->blen);