maint: use "test x = x", not "test x == x"
[hivex.git] / sh / hivexsh.c
index 332b773..a9b738e 100644 (file)
@@ -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. */