Fix a coverity warning about a no-op assert with-64 bit size_t

This is CID 1403400
This commit is contained in:
Nick Mathewson 2017-06-26 10:31:13 -04:00
parent 2c49a9852d
commit 0c7c49483f

View File

@ -210,7 +210,9 @@ storage_dir_read(storage_dir_t *d, const char *fname, int bin, size_t *sz_out)
char *contents = read_file_to_str(path, flags, &st); char *contents = read_file_to_str(path, flags, &st);
if (contents && sz_out) { if (contents && sz_out) {
// it fits in RAM, so we know its size is less than SIZE_MAX // it fits in RAM, so we know its size is less than SIZE_MAX
#if UINT64_MAX > SIZE_MAX
tor_assert((uint64_t)st.st_size <= SIZE_MAX); tor_assert((uint64_t)st.st_size <= SIZE_MAX);
#endif
*sz_out = (size_t) st.st_size; *sz_out = (size_t) st.st_size;
} }