init both fds passed to pipe as -1 instead of initing one twice
authorjsg <jsg@openbsd.org>
Tue, 21 Apr 2015 01:41:42 +0000 (01:41 +0000)
committerjsg <jsg@openbsd.org>
Tue, 21 Apr 2015 01:41:42 +0000 (01:41 +0000)
ok deraadt@ guenther@ miod@ millert@

usr.bin/vi/ex/ex_cscope.c

index 0bca4cb..4e00e6e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ex_cscope.c,v 1.24 2015/01/16 06:40:14 deraadt Exp $  */
+/*     $OpenBSD: ex_cscope.c,v 1.25 2015/04/21 01:41:42 jsg Exp $      */
 
 /*-
  * Copyright (c) 1994, 1996
@@ -359,7 +359,7 @@ run_cscope(SCR *sp, CSC *csc, char *dbname)
         * Cscope reads from to_cs[0] and writes to from_cs[1]; vi reads from
         * from_cs[0] and writes to to_cs[1].
         */
-       to_cs[0] = to_cs[1] = from_cs[0] = from_cs[0] = -1;
+       to_cs[0] = to_cs[1] = from_cs[0] = from_cs[1] = -1;
        if (pipe(to_cs) < 0 || pipe(from_cs) < 0) {
                msgq(sp, M_SYSERR, "pipe");
                goto err;