summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorHugh Graham <hugh@cvs.openbsd.org>2006-05-15 04:18:20 +0000
committerHugh Graham <hugh@cvs.openbsd.org>2006-05-15 04:18:20 +0000
commit88c7a6e688d3d370a5e9b00c9232f8424bf52a51 (patch)
treea4a3f3605aa1a04a15ca1652081dcff96303a200 /lib/libc
parent6e1b62d3e0194c93e8e6d3aa8a6eb0ec26a539d4 (diff)
Handle empty terminal names more gracefully.
Variously OK.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/getcap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/gen/getcap.c b/lib/libc/gen/getcap.c
index 746593f83fe..0493af0d01f 100644
--- a/lib/libc/gen/getcap.c
+++ b/lib/libc/gen/getcap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getcap.c,v 1.26 2006/03/22 02:42:11 ray Exp $ */
+/* $OpenBSD: getcap.c,v 1.27 2006/05/15 04:18:19 hugh Exp $ */
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -591,6 +591,8 @@ cgetmatch(char *buf, const char *name)
char *bp;
const char *np;
+ if (*name == '\0')
+ return (-1);
/*
* Start search at beginning of record.
*/