]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: fix printf stuff
authorKarel Zak <kzak@redhat.com>
Tue, 15 Oct 2013 11:26:12 +0000 (13:26 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 23 Oct 2013 08:46:10 +0000 (10:46 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
fdisks/fdisk-ask.c
fdisks/fdisk-menu.c
fdisks/fdisk.c

index f3dffcb8748eb9f6de3841627c6b75a1f097d5dc..7de40b435c525091cc6113de899fb86c46d3039a 100644 (file)
@@ -66,7 +66,7 @@ static int ask_number(struct fdisk_context *cxt,
        assert(q);
 
        DBG(ASK, dbgprint("asking for number "
-                       "['%s', <%jd,%jd>, default=%jd, range: %s]",
+                       "['%s', <%ju,%ju>, default=%ju, range: %s]",
                        q, low, high, dflt, range));
 
        if (range && dflt >= low && dflt <= high) {
@@ -74,7 +74,7 @@ static int ask_number(struct fdisk_context *cxt,
                        snprintf(prompt, sizeof(prompt), _("%s (%s, default %c): "),
                                        q, range, tochar(dflt));
                else
-                       snprintf(prompt, sizeof(prompt), _("%s (%s, default %jd): "),
+                       snprintf(prompt, sizeof(prompt), _("%s (%s, default %ju): "),
                                        q, range, dflt);
 
        } else if (dflt >= low && dflt <= high) {
@@ -82,13 +82,13 @@ static int ask_number(struct fdisk_context *cxt,
                        snprintf(prompt, sizeof(prompt), _("%s (%c-%c, default %c): "),
                                        q, tochar(low), tochar(high), tochar(dflt));
                else
-                       snprintf(prompt, sizeof(prompt), _("%s (%jd-%jd, default %jd): "),
+                       snprintf(prompt, sizeof(prompt), _("%s (%ju-%ju, default %ju): "),
                                        q, low, high, dflt);
        } else if (inchar)
                snprintf(prompt, sizeof(prompt), _("%s (%c-%c): "),
                                q, tochar(low), tochar(high));
        else
-               snprintf(prompt, sizeof(prompt), _("%s (%jd-%jd): "),
+               snprintf(prompt, sizeof(prompt), _("%s (%ju-%ju): "),
                                q, low, high);
 
        do {
@@ -136,15 +136,15 @@ static int ask_offset(struct fdisk_context *cxt,
 
        assert(q);
 
-       DBG(ASK, dbgprint("asking for offset ['%s', <%jd,%jd>, base=%jd, default=%jd, range: %s]",
+       DBG(ASK, dbgprint("asking for offset ['%s', <%ju,%ju>, base=%ju, default=%ju, range: %s]",
                                q, low, high, base, dflt, range));
 
        if (range && dflt >= low && dflt <= high)
-               snprintf(prompt, sizeof(prompt), _("%s (%s, default %jd): "), q, range, dflt);
+               snprintf(prompt, sizeof(prompt), _("%s (%s, default %ju): "), q, range, dflt);
        else if (dflt >= low && dflt <= high)
-               snprintf(prompt, sizeof(prompt), _("%s (%jd-%jd, default %jd): "), q, low, high, dflt);
+               snprintf(prompt, sizeof(prompt), _("%s (%ju-%ju, default %ju): "), q, low, high, dflt);
        else
-               snprintf(prompt, sizeof(prompt), _("%s (%jd-%jd): "), q, low, high);
+               snprintf(prompt, sizeof(prompt), _("%s (%ju-%ju): "), q, low, high);
 
        do {
                uint64_t num = 0;
@@ -166,7 +166,7 @@ static int ask_offset(struct fdisk_context *cxt,
                rc = parse_size(p, &num, &pwr);
                if (rc)
                        continue;
-               DBG(ASK, dbgprint("parsed size: %jd", num));
+               DBG(ASK, dbgprint("parsed size: %ju", num));
                if (sig && pwr) {
                        /* +{size}{K,M,...} specified, the "num" is in bytes */
                        uint64_t unit = fdisk_ask_number_get_unit(ask);
@@ -178,7 +178,7 @@ static int ask_offset(struct fdisk_context *cxt,
                else if (sig == '-')
                        num = base - num;
 
-               DBG(ASK, dbgprint("final offset: %jd [sig: %c, power: %d, %s]",
+               DBG(ASK, dbgprint("final offset: %ju [sig: %c, power: %d, %s]",
                                num, sig, pwr,
                                sig ? "relative" : "absolute"));
                if (num >= low && num <= high) {
index 0186e1285ccec2e36bb748bd6ad11359a99d7e81..daa47d1e345bfafc680e9cd1a035cc729475809e 100644 (file)
@@ -484,9 +484,9 @@ static int generic_menu_cb(struct fdisk_context **cxt0,
                if (!rc)
                        rc = fdisk_delete_partition(cxt, n);
                if (rc)
-                       fdisk_warnx(cxt, _("Could not delete partition %d"), (int) n + 1);
+                       fdisk_warnx(cxt, _("Could not delete partition %zu"), n + 1);
                else
-                       fdisk_info(cxt, _("Partition %d has been deleted."), (int) n + 1);
+                       fdisk_info(cxt, _("Partition %zu has been deleted."), n + 1);
                break;
        case 'l':
                list_partition_types(cxt);
index 01e8149ab92c9887254748bf82fd2219bbac2d76..1b96424ccfdb0656e09c294538e177d93810ab96 100644 (file)
@@ -199,10 +199,9 @@ void list_disk_geometry(struct fdisk_context *cxt)
        char *strsz = size_to_human_string(SIZE_SUFFIX_SPACE
                                           | SIZE_SUFFIX_3LETTER, bytes);
 
-       fdisk_colon(cxt,        _("Disk %s: %s, %llu bytes, %llu sectors"),
+       fdisk_colon(cxt,        _("Disk %s: %s, %ju bytes, %ju sectors"),
                        cxt->dev_path, strsz,
-                       (unsigned long long) bytes,
-                       (unsigned long long) cxt->total_sectors);
+                       bytes, (uintmax_t) cxt->total_sectors);
        free(strsz);
 
        if (fdisk_require_geometry(cxt) || fdisk_context_use_cylinders(cxt))