From 311b2f3a3ece99c75d68341e6fbdff810eeac082 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 26 Feb 2010 11:50:35 +0000 Subject: [PATCH] hivexsh: Fix compilation on 32 bit machines. --- sh/hivexsh.c | 4 ++++ 1 file changed, 4 insertions(+) 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. */ -- 1.8.3.1