fix build on amd64: guint32 and size_t may be different type, so usage of std::min is incorrect

This commit is contained in:
Evgeniy Dushistov
2007-09-30 16:27:08 +00:00
parent 98ec160803
commit db87b6a7c2

View File

@@ -513,7 +513,10 @@ inline const gchar *offset_index::read_first_on_page_key(glong page_idx)
{
fseek(idxfile, wordoffset[page_idx], SEEK_SET);
guint32 page_size=wordoffset[page_idx+1]-wordoffset[page_idx];
fread(wordentry_buf, std::min(sizeof(wordentry_buf), page_size), 1, idxfile); //TODO: check returned values, deal with word entry that strlen>255.
fread(wordentry_buf,
std::min(sizeof(wordentry_buf), static_cast<size_t>(page_size)),
1, idxfile);
//TODO: check returned values, deal with word entry that strlen>255.
return wordentry_buf;
}