From: Richard W.M. Jones Date: Fri, 26 Feb 2010 11:50:35 +0000 (+0000) Subject: hivexsh: Fix compilation on 32 bit machines. X-Git-Tag: 1.2.0~8 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;ds=inline;h=311b2f3a3ece99c75d68341e6fbdff810eeac082;p=hivex.git hivexsh: Fix compilation on 32 bit machines. --- 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. */