summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2010-02-26 11:50:35 +0000
committerRichard W.M. Jones <rjones@redhat.com>2010-02-26 11:51:04 +0000
commit311b2f3a3ece99c75d68341e6fbdff810eeac082 (patch)
treed84027d9d2e1e227b90e17ad7fc8e553db0b8d13
parentbf8a94f8b3d11737a153522a4831cfb73cbe4614 (diff)
downloadhivex-311b2f3a3ece99c75d68341e6fbdff810eeac082.tar.gz
hivex-311b2f3a3ece99c75d68341e6fbdff810eeac082.tar.xz
hivex-311b2f3a3ece99c75d68341e6fbdff810eeac082.zip
hivexsh: Fix compilation on 32 bit machines.
-rw-r--r--sh/hivexsh.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sh/hivexsh.c b/sh/hivexsh.c
index 332b773..fe5857e 100644
--- a/sh/hivexsh.c
+++ b/sh/hivexsh.c
@@ -946,11 +946,13 @@ cmd_setval (char *nrvals_str)
"setval", "dword", "xstrtol", xerr);
goto error;
}
+#if SIZEOF_LONG > 4
if (n < 0 || n > UINT32_MAX) {
fprintf (stderr, _("%s: %s: integer out of range\n"),
"setval", "dword");
goto error;
}
+#endif
uint32_t u32 = htole32 (n);
memcpy (values[i].value, &u32, 4);
}
@@ -999,11 +1001,13 @@ cmd_setval (char *nrvals_str)
"setval", "hex", "xstrtol", xerr);
goto error;
}
+#if SIZEOF_LONG > 4
if (t < 0 || t > UINT32_MAX) {
fprintf (stderr, _("%s: %s: integer out of range\n"),
"setval", "hex");
goto error;
}
+#endif
values[i].t = t;
/* Read the hex data. */