X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=sh%2Fhivexsh.c;fp=sh%2Fhivexsh.c;h=fe5857ef664cdede366494817a6709211919e4bf;hb=311b2f3a3ece99c75d68341e6fbdff810eeac082;hp=332b77391aceddd2cc94255722a970b1e1c2f5e5;hpb=bf8a94f8b3d11737a153522a4831cfb73cbe4614;p=hivex.git 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. */