buffer: untangle assignment from check in makenewline().
For better debuggability. Michael
This commit is contained in:
parent
ab4df6edb8
commit
25344751eb
@ -66,10 +66,12 @@ makenewline (unsigned char *data, size_t length)
|
|||||||
assert (data != NULL);
|
assert (data != NULL);
|
||||||
assert (length > 0);
|
assert (length > 0);
|
||||||
|
|
||||||
if (!(newline = safemalloc (sizeof (struct bufline_s))))
|
newline = safemalloc (sizeof (struct bufline_s));
|
||||||
|
if (!newline)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!(newline->string = safemalloc (length)))
|
newline->string = safemalloc (length);
|
||||||
|
if (!newline->string)
|
||||||
{
|
{
|
||||||
safefree (newline);
|
safefree (newline);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user