Fixed bug in cspace -- precdence of == is less that '+'.
authorElan Amir <elan@ucbvax.Berkeley.EDU>
Sat, 16 Jan 1993 05:53:08 +0000 (21:53 -0800)
committerElan Amir <elan@ucbvax.Berkeley.EDU>
Sat, 16 Jan 1993 05:53:08 +0000 (21:53 -0800)
SCCS-vsn: usr.bin/sed/process.c 5.12

usr/src/usr.bin/sed/process.c

index a007ca9..88c4625 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)process.c  5.11 (Berkeley) %G%";
+static char sccsid[] = "@(#)process.c  5.12 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -540,7 +540,7 @@ 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);
        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);