summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2021-01-20 20:41:51 +0100
committerMax Kellermann <max@musicpd.org>2021-01-20 20:44:47 +0100
commit9551166f2795238cda1089dc7de2ff02ec1dcce4 (patch)
treebf0595ab219709374785723f33ff2f16e5f5da20
parent2a8c420cff6844266bccc444af061027164f3403 (diff)
command/file: use %zu to format a size_t
`PRIoffset` was wrong, because it expects an `offset_type` (i.e. `uint64_t`). This broke on 32 bit machines where `size_t` has 32 bits. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1058
-rw-r--r--NEWS2
-rw-r--r--src/command/FileCommands.cxx2
2 files changed, 3 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 05f56ef39..f6172c454 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
ver 0.22.4 (not yet released)
+* protocol
+ - fix "readpicture" on 32 bit machines
* storage
- curl: fix several WebDAV protocol bugs
* decoder
diff --git a/src/command/FileCommands.cxx b/src/command/FileCommands.cxx
index e50e3324d..dc68463aa 100644
--- a/src/command/FileCommands.cxx
+++ b/src/command/FileCommands.cxx
@@ -296,7 +296,7 @@ public:
return;
}
- response.Format("size: %" PRIoffset "\n", buffer.size);
+ response.Format("size: %zu\n", buffer.size);
if (mime_type != nullptr)
response.Format("type: %s\n", mime_type);