Fix GCC's -Wsign-conversion error
authorAlessio Chiapperini <[email protected]>
Wed, 6 Apr 2022 13:03:40 +0000 (6 15:03 +0200)
committerAlessio Chiapperini <[email protected]>
Wed, 6 Apr 2022 13:03:40 +0000 (6 15:03 +0200)
We can cast the offset to size_t since we never pass a negative offset
to the function.

src/cat/cat.c

index 6082437..b97d187 100644 (file)
@@ -65,7 +65,7 @@ print_rev(char *buf, off_t off)
 {
        char dst[N];
        int ret;
-       size_t blen = off % N ? off % N : N;
+       size_t blen = off % N ? (size_t)off % N : N;
 
        ret = 0;
        while (off > 0) {