diff options
| author | Christoph Berg | 2020-11-02 15:44:54 +0000 |
|---|---|---|
| committer | Christoph Berg | 2020-11-02 15:44:54 +0000 |
| commit | 927ea61271b1d14ad1dbd7c54fcbd7d99d232165 (patch) | |
| tree | 12da46e59cfc7dd9cf7c2ebbcf9b6765ad890a84 /decode.c | |
| parent | e426b8eb18f498b4459753852a05fbc555a4a762 (diff) | |
decode.c: Fix int64 format strings for 32 bit architectures
Diffstat (limited to 'decode.c')
| -rw-r--r-- | decode.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -522,7 +522,7 @@ decode_bigint(const char *buffer, unsigned int buff_size, unsigned int *out_size if (buff_size < sizeof(int64)) return -2; - CopyAppendFmt("%ld", *(int64 *) buffer); + CopyAppendFmt(INT64_FORMAT, *(int64 *) buffer); *out_size = sizeof(int64) + delta; return 0; } @@ -549,7 +549,7 @@ decode_time(const char *buffer, unsigned int buff_size, unsigned int *out_size) timestamp_sec = timestamp / 1000000; *out_size = sizeof(int64) + delta; - CopyAppendFmt("%02ld:%02ld:%02ld.%06ld", + CopyAppendFmt("%02" INT64_MODIFIER "d:%02" INT64_MODIFIER "d:%02" INT64_MODIFIER "d.%06" INT64_MODIFIER "d", timestamp_sec / 60 / 60, (timestamp_sec / 60) % 60, timestamp_sec % 60, timestamp % 1000000); @@ -582,7 +582,7 @@ decode_timetz(const char *buffer, unsigned int buff_size, unsigned int *out_size tz_min = -(tz_sec / 60); *out_size = sizeof(int64) + sizeof(int32) + delta; - CopyAppendFmt("%02ld:%02ld:%02ld.%06ld%c%02d:%02d", + CopyAppendFmt("%02" INT64_MODIFIER "d:%02" INT64_MODIFIER "d:%02" INT64_MODIFIER "d.%06" INT64_MODIFIER "d%c%02d:%02d", timestamp_sec / 60 / 60, (timestamp_sec / 60) % 60, timestamp_sec % 60, timestamp % 1000000, (tz_min > 0 ? '+' : '-'), abs(tz_min / 60), abs(tz_min % 60)); @@ -660,7 +660,7 @@ decode_timestamp(const char *buffer, unsigned int buff_size, unsigned int *out_s j2date(jd, &year, &month, &day); timestamp_sec = timestamp / 1000000; - CopyAppendFmt("%04d-%02d-%02d %02ld:%02ld:%02ld.%06ld%s", + CopyAppendFmt("%04d-%02d-%02d %02" INT64_MODIFIER "d:%02" INT64_MODIFIER "d:%02" INT64_MODIFIER "d.%06" INT64_MODIFIER "d%s", (year <= 0) ? -year + 1 : year, month, day, timestamp_sec / 60 / 60, (timestamp_sec / 60) % 60, timestamp_sec % 60, timestamp % 1000000, |
