Commit 41cdc4e1 authored by Max Kellermann's avatar Max Kellermann

input/Offset: add macro PRIoffset

parent 87dfca04
...@@ -29,4 +29,10 @@ ...@@ -29,4 +29,10 @@
*/ */
typedef uint64_t offset_type; typedef uint64_t offset_type;
/**
* To format an offset_type with printf(). To use this, include
* <cinttypes>.
*/
#define PRIoffset PRIu64
#endif #endif
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
#include "Log.hxx" #include "Log.hxx"
#include "PluginUnavailable.hxx" #include "PluginUnavailable.hxx"
#include <cinttypes>
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
...@@ -416,7 +418,7 @@ CurlInputStream::SeekInternal(offset_type new_offset) ...@@ -416,7 +418,7 @@ CurlInputStream::SeekInternal(offset_type new_offset)
if (offset > 0) { if (offset > 0) {
char range[32]; char range[32];
sprintf(range, "%llu-", (unsigned long long)offset); sprintf(range, "%" PRIoffset "-", offset);
request->SetOption(CURLOPT_RANGE, range); request->SetOption(CURLOPT_RANGE, range);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment