From 98a4837c1a6a4a82c632e5bed50583e9c71e478a Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 13 Jul 2021 19:56:54 -0700 Subject: [PATCH] _sffilbuf: squash a -Wsign-compare warning The variable r is known to be greater than 0 in this branch. --- lib/sfio/sffilbuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sfio/sffilbuf.c b/lib/sfio/sffilbuf.c index bf977f87d..89c458060 100644 --- a/lib/sfio/sffilbuf.c +++ b/lib/sfio/sffilbuf.c @@ -9,6 +9,7 @@ *************************************************************************/ #include +#include /* Fill the buffer of a stream with data. ** If n < 0, sffilbuf() attempts to fill the buffer if it's empty. @@ -55,7 +56,7 @@ int _sffilbuf(Sfio_t * f, int n) /* try shifting left to make room for new data */ if (!(f->bits & SF_MMAP) && f->next > f->data && n > (f->size - (f->endb - f->data))) { - memcpy(f->data, f->next, r); + memcpy(f->data, f->next, (size_t)r); f->next = f->data; f->endb = f->data + r; } -- 2.40.0