=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mg/cscope.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- src/usr.bin/mg/cscope.c 2017/10/12 14:12:00 1.17 +++ src/usr.bin/mg/cscope.c 2019/07/03 03:24:02 1.18 @@ -1,4 +1,4 @@ -/* $OpenBSD: cscope.c,v 1.17 2017/10/12 14:12:00 florian Exp $ */ +/* $OpenBSD: cscope.c,v 1.18 2019/07/03 03:24:02 deraadt Exp $ */ /* * This file is in the public domain. @@ -634,7 +634,7 @@ dir[--dlen] = '\0'; /* strip trailing '/' */ len = snprintf(fname, sizeof(fname), "%s/%s", dir, cmd); - if (len == -1 || len >= sizeof(fname)) { + if (len < 0 || len >= sizeof(fname)) { dobeep(); ewprintf("path too long"); goto cleanup;