]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd/fsx.cc: fix int/unsigned long conversion
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 21 May 2015 22:35:46 +0000 (00:35 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 1 Jun 2015 04:59:26 +0000 (06:59 +0200)
getnum() returns an integer while maxfilelen is a unsinged long.
Use a temp var to be able to check the result of the call.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/test/librbd/fsx.cc

index da93263d22990f728d7766cefb41a68d2e942dc4..427401acebbedc69dcbb7b5981c95e74c97c32c4 100644 (file)
@@ -2023,9 +2023,10 @@ main(int argc, char **argv)
                                usage();
                        break;
                case 'l':
-                       maxfilelen = getnum(optarg, &endp);
-                       if (maxfilelen <= 0)
+                       int _num = getnum(optarg, &endp);
+                       if (_num <= 0)
                                usage();
+                       maxfilelen = _num;
                        break;
                case 'm':
                        monitorstart = getnum(optarg, &endp);