From 9551166f2795238cda1089dc7de2ff02ec1dcce4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 20 Jan 2021 20:41:51 +0100 Subject: [PATCH] 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 --- NEWS | 2 ++ src/command/FileCommands.cxx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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);