diff options
author | Karl Ramm <kcr@1ts.org> | 2010-08-22 00:56:16 +0000 |
---|---|---|
committer | Karl Ramm <kcr@1ts.org> | 2010-08-22 00:56:16 +0000 |
commit | 63d1172508ff4ad0f5bf88b5f9f94d083a36664d (patch) | |
tree | 83eb59af4920bb0b9a91dadf7409bc9e9aad5078 /lib/Zinternal.c | |
parent | 5e5001904aaf810f2ae395959f8e5407f9b89b16 (diff) |
fix an allocation-size braino and rearrange for readability
Diffstat (limited to 'lib/Zinternal.c')
-rw-r--r-- | lib/Zinternal.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/lib/Zinternal.c b/lib/Zinternal.c index 7c9bb4a..189fa6e 100644 --- a/lib/Zinternal.c +++ b/lib/Zinternal.c @@ -581,15 +581,14 @@ Z_AddNoticeToEntry(struct _Z_InputQ *qptr, hole = hole->next; } if (lasthole) { - if (!(lasthole->next = (struct _Z_Hole *) - malloc(sizeof(struct _Z_InputQ)))) - return (ENOMEM); + lasthole->next = (struct _Z_Hole *)malloc(sizeof(struct _Z_Hole)); + if (lasthole->next == NULL) + return ENOMEM; hole = lasthole->next; - } - else { - if (!(qptr->holelist = (struct _Z_Hole *) - malloc(sizeof(struct _Z_InputQ)))) - return (ENOMEM); + } else { + qptr->holelist = (struct _Z_Hole *)malloc(sizeof(struct _Z_Hole)); + if (qptr->holelist == NULL) + return ENOMEM; hole = qptr->holelist; } hole->next = NULL; @@ -605,15 +604,14 @@ Z_AddNoticeToEntry(struct _Z_InputQ *qptr, hole = hole->next; } if (lasthole) { - if (!(lasthole->next = (struct _Z_Hole *) - malloc(sizeof(struct _Z_InputQ)))) - return (ENOMEM); + lasthole->next = (struct _Z_Hole *)malloc(sizeof(struct _Z_Hole)); + if (lasthole->next == NULL) + return ENOMEM; hole = lasthole->next; - } - else { - if (!(qptr->holelist = (struct _Z_Hole *) - malloc(sizeof(struct _Z_InputQ)))) - return (ENOMEM); + } else { + qptr->holelist = (struct _Z_Hole *)malloc(sizeof(struct _Z_Hole)); + if (qptr->holelist == NULL) + return ENOMEM; hole = qptr->holelist; } hole->next = (struct _Z_Hole *) 0; |