From 25344751eb629e1d646535a4cfe5899e9a35727c Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 4 Aug 2009 14:46:54 +0200 Subject: buffer: untangle assignment from check in makenewline(). For better debuggability. Michael --- src/buffer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/buffer.c b/src/buffer.c index 4df30aa..853fb86 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -66,10 +66,12 @@ makenewline (unsigned char *data, size_t length) assert (data != NULL); assert (length > 0); - if (!(newline = safemalloc (sizeof (struct bufline_s)))) + newline = safemalloc (sizeof (struct bufline_s)); + if (!newline) return NULL; - if (!(newline->string = safemalloc (length))) + newline->string = safemalloc (length); + if (!newline->string) { safefree (newline); return NULL; -- cgit v1.2.3