]> sourceware.org Git - lvm2.git/commitdiff
coverity: sscanf should use "%u" instead of "%i"
authorPeter Rajnoha <prajnoha@redhat.com>
Thu, 17 Oct 2013 08:11:53 +0000 (10:11 +0200)
committerPeter Rajnoha <prajnoha@redhat.com>
Thu, 17 Oct 2013 08:17:16 +0000 (10:17 +0200)
The "age" variable is unsigned:

  unsigned age = 0;
  ...
  if (argc == 2 && (sscanf(argv[1], "%i", &age) != 1))

tools/dmsetup.c

index 517e8aa641f6b9ff58eb78f44ce7390a6aca53c8..a0ee23ee5d93f139d0ee1be5cf9407502c8fcfcb 100644 (file)
@@ -1147,7 +1147,7 @@ static int _udevcomplete_all(CMD_ARGS)
        unsigned age = 0;
        time_t t;
 
-       if (argc == 2 && (sscanf(argv[1], "%i", &age) != 1)) {
+       if (argc == 2 && (sscanf(argv[1], "%u", &age) != 1)) {
                log_error("Failed to read age_in_minutes parameter.");
                return 0;
        }
This page took 0.050492 seconds and 5 git commands to generate.