From bd800938b272e69467becda77e51e6c8b12ab9cf Mon Sep 17 00:00:00 2001 From: Jonathon Fernyhough Date: Thu, 8 Apr 2021 21:34:40 +0100 Subject: [PATCH] Try to make OFF_T_PF less flaky --- src/format_string.h | 15 +++------------ src/legacy_http.c | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/format_string.h b/src/format_string.h index 7b21773..abcce4c 100644 --- a/src/format_string.h +++ b/src/format_string.h @@ -21,17 +21,8 @@ # define SIZE_T_PF "%u" #endif -#if SIZEOF_OFF_T == 8 -# ifdef PRIu64 -# define OFF_T_PF "%" PRIu64 -# else -# define OFF_T_PF "%llu" -# endif +#ifdef PRIu64 +# define OFF_T_PF "%" PRIu64 #else -# ifdef PRIu32 -# define OFF_T_PF "%" PRIu32 -# else -# define OFF_T_PF "%lu" -# endif +# define OFF_T_PF "%llu" #endif - diff --git a/src/legacy_http.c b/src/legacy_http.c index 7c67a84..eaee2eb 100644 --- a/src/legacy_http.c +++ b/src/legacy_http.c @@ -571,7 +571,7 @@ int range_fetch_read_http_headers(struct range_fetch *rf) { p += 2; buflwr(buf); { /* Remove the trailing \r\n from the value */ - int len = strcspn(p, "\r\n"); + uint64_t len = strcspn(p, "\r\n"); p[len] = 0; } /* buf is the header name (lower-cased), p the value */