From 8d83067e01a0b43472f48c16ce94d2ecfe015af4 Mon Sep 17 00:00:00 2001 From: okan Date: Sun, 28 Jun 2015 19:50:46 +0000 Subject: replace assert usage --- client.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'client.c') diff --git a/client.c b/client.c index 857ff8e..94f00f9 100644 --- a/client.c +++ b/client.c @@ -15,13 +15,12 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: client.c,v 1.194 2015/06/26 17:17:46 okan Exp $ + * $OpenBSD: client.c,v 1.195 2015/06/28 19:50:46 okan Exp $ */ #include #include -#include #include #include #include @@ -635,8 +634,8 @@ match: /* Now, do some garbage collection. */ if (cc->nameqlen > CLIENT_MAXNAMEQLEN) { - wn = TAILQ_FIRST(&cc->nameq); - assert(wn != NULL); + if ((wn = TAILQ_FIRST(&cc->nameq)) == NULL) + errx(1, "client_setname: window name queue empty"); TAILQ_REMOVE(&cc->nameq, wn, entry); free(wn->name); free(wn); -- cgit v1.2.3-2-gb3c3