diff options
author | Ramsay Jones <ramsay@ramsayjones.plus.com> | 2017-09-21 17:46:24 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-22 13:00:33 +0900 |
commit | 73560c793a08b389cc8ad5930db2cebb858affcb (patch) | |
tree | d0ae304b5a65f56a652884917f2c00772dd4ffa4 /git-compat-util.h | |
parent | RelNotes: further fixes for 2.14.2 from the master front (diff) | |
download | tgif-73560c793a08b389cc8ad5930db2cebb858affcb.tar.xz |
git-compat-util.h: xsize_t() - avoid -Wsign-compare warnings
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r-- | git-compat-util.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index 7d2c0ca759..bf4869dcef 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -900,9 +900,11 @@ static inline char *xstrdup_or_null(const char *str) static inline size_t xsize_t(off_t len) { - if (len > (size_t) len) + size_t size = (size_t) len; + + if (len != (off_t) size) die("Cannot handle files this big"); - return (size_t)len; + return size; } __attribute__((format (printf, 3, 4))) |