X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=sh%2Fhivexsh.c;h=a9b738e7e918965df8bc89cec21ad309d05bc90e;hb=2419bda3b4b47687c787a2937238fee932ad66e5;hp=332b77391aceddd2cc94255722a970b1e1c2f5e5;hpb=e8928b001ed31694031257202775375e2f50e1a8;p=hivex.git diff --git a/sh/hivexsh.c b/sh/hivexsh.c index 332b773..a9b738e 100644 --- a/sh/hivexsh.c +++ b/sh/hivexsh.c @@ -108,7 +108,7 @@ main (int argc, char *argv[]) set_prompt_string (); - while ((c = getopt (argc, argv, "dfw")) != EOF) { + while ((c = getopt (argc, argv, "df:w")) != EOF) { switch (c) { case 'd': open_flags |= HIVEX_OPEN_DEBUG; @@ -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. */