[haiku-commits] Change in haiku[master]: tools/locale: Fix -Wformat=

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 13 Oct 2020 11:07:28 +0000

From Murai Takashi <tmurai01@xxxxxxxxx>:

Murai Takashi has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/3313 ;)


Change subject: tools/locale: Fix -Wformat=
......................................................................

tools/locale: Fix -Wformat=

Change-Id: I2261a75e32a78fb3e43735bc9c616e101d6d39f5
---
M src/tools/locale/DefaultCatalog.cpp
M src/tools/locale/collectcatkeys.cpp
2 files changed, 7 insertions(+), 4 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/13/3313/1

diff --git a/src/tools/locale/DefaultCatalog.cpp 
b/src/tools/locale/DefaultCatalog.cpp
index 1f480cb..04bd075 100644
--- a/src/tools/locale/DefaultCatalog.cpp
+++ b/src/tools/locale/DefaultCatalog.cpp
@@ -151,7 +151,8 @@

        BStackOrHeapArray<char, 0> buf(sz);
        if (!buf.IsValid()) {
-               fprintf(stderr, "couldn't allocate array of %Ld chars\n", sz);
+               fprintf(stderr, "couldn't allocate array of %" B_PRIdOFF " 
chars\n",
+                       sz);
                return B_NO_MEMORY;
        }
        res = catalogFile.Read(buf, sz);
@@ -161,8 +162,9 @@
        }
        if (res < sz) {
                fprintf(stderr,
-                       "only got %u instead of %Lu bytes from catalog-file 
%s\n", res, sz,
-                       path);
+                       "only got %u instead of %" B_PRIdOFF " bytes "
+                               "from catalog-file %s\n",
+                       res, sz, path);
                return res;
        }
        BMemoryIO memIO(buf, sz);
diff --git a/src/tools/locale/collectcatkeys.cpp 
b/src/tools/locale/collectcatkeys.cpp
index 78ded2d..9aecd96 100644
--- a/src/tools/locale/collectcatkeys.cpp
+++ b/src/tools/locale/collectcatkeys.cpp
@@ -287,7 +287,8 @@
                char *buf = inputStr.LockBuffer(sz);
                off_t rsz = inFile.Read(buf, sz);
                if (rsz < sz) {
-                       fprintf(stderr, "couldn't read %Ld bytes from %s (got 
only %Ld)\n",
+                       fprintf(stderr, "couldn't read %" B_PRIdOFF " bytes 
from %s "
+                                       "(got only %" B_PRIdOFF ")\n",
                                sz, inputFile, rsz);
                        exit(-1);
                }

--
To view, visit https://review.haiku-os.org/c/haiku/+/3313
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I2261a75e32a78fb3e43735bc9c616e101d6d39f5
Gerrit-Change-Number: 3313
Gerrit-PatchSet: 1
Gerrit-Owner: Murai Takashi <tmurai01@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: tools/locale: Fix -Wformat= - Gerrit