summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2013-05-26 12:09:18 +0200
committerportix <portix@gmx.net>2013-05-26 12:09:18 +0200
commit102ae70c5024222ba09032598211fe413127dc73 (patch)
tree42b1b2d260977c436ab396599579f5c6de5f017d
parent8be99288038928117bf5e2de6f2fffb20a376f7d (diff)
downloaddwb-102ae70c5024222ba09032598211fe413127dc73.zip
Initialize all headers in exar.c
-rw-r--r--exar/exar.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/exar/exar.c b/exar/exar.c
index 8a01c863..df14e5ea 100644
--- a/exar/exar.c
+++ b/exar/exar.c
@@ -62,6 +62,7 @@ struct exar_header_s {
off_t eh_size;
char eh_name[EXAR_NAME_MAX];
};
+#define EXAR_HEADER_EMPTY { 0, 0, { 0 } }
#define LOG(level, ...) do { if (s_verbose & EXAR_VERBOSE_L##level) { \
fprintf(stderr, "exar-log%d: ", level); \
@@ -268,7 +269,7 @@ static int
contains(const char *archive, const char *name, int (*cmp)(const char *, const char *))
{
FILE *f = NULL;
- struct exar_header_s header = { 0, 0, {0} };
+ struct exar_header_s header = EXAR_HEADER_EMPTY;
int result = EE_ERROR;
if ((f = open_archive(archive, "r")) == NULL)
@@ -289,7 +290,7 @@ finish:
static unsigned char *
extract(const char *archive, const char *file, off_t *s, int (*cmp)(const char *, const char *))
{
- struct exar_header_s header = { 0, 0, { 0 }};
+ struct exar_header_s header = EXAR_HEADER_EMPTY;
FILE *f = NULL;
unsigned char *ret = NULL;
if (s != NULL)
@@ -464,7 +465,7 @@ exar_unpack(const char *archive, const char *dest)
{
assert(archive != NULL);
- struct exar_header_s header;
+ struct exar_header_s header = EXAR_HEADER_EMPTY;
int ret = EE_ERROR;
FILE *of, *f = NULL;
unsigned char buf[512];
@@ -555,7 +556,7 @@ exar_delete(const char *archive, const char *file)
assert(archive != NULL && file != NULL);
int result = EE_ERROR;
- struct exar_header_s header;
+ struct exar_header_s header = EXAR_HEADER_EMPTY;
FILE *f = NULL, *ftmp = NULL;
char tmp_file[128];
char dir_name[EXAR_NAME_MAX-1] = {0};
@@ -639,7 +640,7 @@ exar_info(const char *archive)
assert(archive != NULL);
FILE *f = NULL;
- struct exar_header_s header = { 0, 0, {0} };
+ struct exar_header_s header = EXAR_HEADER_EMPTY;
if ((f = open_archive(archive, "r")) == NULL)
goto finish;