]> git.cameronkatri.com Git - mandoc.git/commitdiff
No need to assert() that a pointer is non-null right before dereferencing it.
authorIngo Schwarze <schwarze@openbsd.org>
Fri, 10 Oct 2014 14:02:02 +0000 (14:02 +0000)
committerIngo Schwarze <schwarze@openbsd.org>
Fri, 10 Oct 2014 14:02:02 +0000 (14:02 +0000)
The assert message contains no more information than the segfault.

eqn.c

diff --git a/eqn.c b/eqn.c
index fa65811e5d98c7b73a376e21ca4cfdce721fda00..fbbef811033c21d55332e40ed777036d6752faa2 100644 (file)
--- a/eqn.c
+++ b/eqn.c
@@ -1,4 +1,4 @@
-/*     $Id: eqn.c,v 1.49 2014/10/10 09:12:44 kristaps Exp $ */
+/*     $Id: eqn.c,v 1.50 2014/10/10 14:02:02 schwarze Exp $ */
 /*
  * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  *
@@ -537,10 +537,7 @@ eqn_box_alloc(struct eqn_node *ep, struct eqn_box *parent)
        bp->expectargs = UINT_MAX;
        bp->size = ep->gsize;
 
-       assert(NULL != parent);
-
        if (NULL != parent->first) {
-               assert(NULL != parent->last);
                parent->last->next = bp;
                bp->prev = parent->last;
        } else