projects
/
centaur.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleaner error handling with ELFU_WARN and ELFU_WARNELF
[centaur.git]
/
src
/
model
/
expandNobits.c
diff --git
a/src/model/expandNobits.c
b/src/model/expandNobits.c
index 648ee210bcdb9706ce8d54b6dd3969bf03a14c91..d12990e87a995c65c9d7ee9f21cc1acf6ee4528f 100644
(file)
--- a/
src/model/expandNobits.c
+++ b/
src/model/expandNobits.c
@@
-1,5
+1,4
@@
#include <assert.h>
#include <assert.h>
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
@@
-33,7
+32,7
@@
void elfu_mExpandNobits(ElfuElf *me, GElf_Off off)
* to be filled. This means that it relies on the NOBITS area
* being actually 0 bytes, and the expansion would ruin it.
*/
* to be filled. This means that it relies on the NOBITS area
* being actually 0 bytes, and the expansion would ruin it.
*/
-
fprintf(stderr,
"mExpandNobits: Found PHDR spanning expansion offset. Aborting.\n");
+
ELFU_WARN(
"mExpandNobits: Found PHDR spanning expansion offset. Aborting.\n");
return;
}
} else {
return;
}
} else {
@@
-101,7
+100,7
@@
void elfu_mExpandNobits(ElfuElf *me, GElf_Off off)
ms->data.d_buf = malloc(ms->shdr.sh_size);
memset(ms->data.d_buf, '\0', ms->shdr.sh_size);
if (!ms->data.d_buf) {
ms->data.d_buf = malloc(ms->shdr.sh_size);
memset(ms->data.d_buf, '\0', ms->shdr.sh_size);
if (!ms->data.d_buf) {
-
fprintf(stderr,
"mExpandNobits: Could not allocate %jd bytes for NOBITS expansion.\n", ms->shdr.sh_size);
+
ELFU_WARN(
"mExpandNobits: Could not allocate %jd bytes for NOBITS expansion.\n", ms->shdr.sh_size);
}
ms->data.d_align = 1;
}
ms->data.d_align = 1;