summaryrefslogtreecommitdiff
path: root/usr.bin/sed/misc.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2006-10-09 00:23:58 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2006-10-09 00:23:58 +0000
commit3732eb3f0c0befa9bd4971d43fe9014683618dd7 (patch)
treeb50c3571243730bef77592440a5cccc7badbbd51 /usr.bin/sed/misc.c
parentb29db7291c1ecef2e19f2582a2eebec69a25e687 (diff)
pretty. the comma operator should not be used to cram two statements into
an if without braces, or worse, into a return.
Diffstat (limited to 'usr.bin/sed/misc.c')
-rw-r--r--usr.bin/sed/misc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.bin/sed/misc.c b/usr.bin/sed/misc.c
index 18fee03a552..ba6055d31a2 100644
--- a/usr.bin/sed/misc.c
+++ b/usr.bin/sed/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.6 2004/07/20 03:50:26 deraadt Exp $ */
+/* $OpenBSD: misc.c,v 1.7 2006/10/09 00:23:57 tedu Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -35,7 +35,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93"; */
-static char *rcsid = "$OpenBSD: misc.c,v 1.6 2004/07/20 03:50:26 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: misc.c,v 1.7 2006/10/09 00:23:57 tedu Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -69,8 +69,6 @@ xmalloc(u_int size)
void *
xrealloc(void *p, u_int size)
{
- if (p == NULL) /* Compatibility hack. */
- return (xmalloc(size));
if ((p = realloc(p, size)) == NULL)
err(FATAL, "%s", strerror(errno));
@@ -88,8 +86,7 @@ strregerror(int errcode, regex_t *preg)
static char *oe;
size_t s;
- if (oe != NULL)
- free(oe);
+ free(oe);
s = regerror(errcode, preg, "", 0);
oe = xmalloc(s);
(void)regerror(errcode, preg, oe, s);