git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix error handling in 'zero' function.
[libguestfs.git]
/
hivex
/
hivex.c
diff --git
a/hivex/hivex.c
b/hivex/hivex.c
index
ac46346
..
e47dd23
100644
(file)
--- a/
hivex/hivex.c
+++ b/
hivex/hivex.c
@@
-30,7
+30,6
@@
#include <iconv.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <iconv.h>
#include <sys/mman.h>
#include <sys/stat.h>
-#include <assert.h>
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#endif
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#endif
@@
-144,7
+143,7
@@
struct ntreg_hbin_block {
} __attribute__((__packed__));
#define BLOCK_ID_EQ(h,offs,eqid) \
} __attribute__((__packed__));
#define BLOCK_ID_EQ(h,offs,eqid) \
- (
strncmp (((struct ntreg_hbin_block *)((h)->addr + (offs)))->id, (eqid), 2) == 0
)
+ (
STREQLEN (((struct ntreg_hbin_block *)((h)->addr + (offs)))->id, (eqid), 2)
)
static size_t
block_len (hive_h *h, size_t blkoff, int *used)
static size_t
block_len (hive_h *h, size_t blkoff, int *used)
@@
-236,7
+235,7
@@
hivex_open (const char *filename, int flags)
h->msglvl = flags & HIVEX_OPEN_MSGLVL_MASK;
const char *debug = getenv ("HIVEX_DEBUG");
h->msglvl = flags & HIVEX_OPEN_MSGLVL_MASK;
const char *debug = getenv ("HIVEX_DEBUG");
- if (debug &&
strcmp (debug, "1") == 0
)
+ if (debug &&
STREQ (debug, "1")
)
h->msglvl = 2;
if (h->msglvl >= 2)
h->msglvl = 2;
if (h->msglvl >= 2)
@@
-726,7
+725,7
@@
hivex_node_get_child (hive_h *h, hive_node_h node, const char *nname)
for (i = 0; children[i] != 0; ++i) {
name = hivex_node_name (h, children[i]);
if (!name) goto error;
for (i = 0; children[i] != 0; ++i) {
name = hivex_node_name (h, children[i]);
if (!name) goto error;
- if (
strcasecmp (name, nname) == 0
) {
+ if (
STRCASEEQ (name, nname)
) {
ret = children[i];
break;
}
ret = children[i];
break;
}
@@
-857,7
+856,7
@@
hivex_node_get_value (hive_h *h, hive_node_h node, const char *key)
for (i = 0; values[i] != 0; ++i) {
name = hivex_value_key (h, values[i]);
if (!name) goto error;
for (i = 0; values[i] != 0; ++i) {
name = hivex_value_key (h, values[i]);
if (!name) goto error;
- if (
strcasecmp (name, key) == 0
) {
+ if (
STRCASEEQ (name, key)
) {
ret = values[i];
break;
}
ret = values[i];
break;
}