Ticket #29002: patch-min.diff

File patch-min.diff, 732 bytes (added by ryandesign (Ryan Carsten Schmidt), 14 years ago)
  • src/lib/lib.cpp

    This is upstream r26 to fix wrong use of std::min on 64-bit systems
     
    513513{
    514514        fseek(idxfile, wordoffset[page_idx], SEEK_SET);
    515515        guint32 page_size=wordoffset[page_idx+1]-wordoffset[page_idx];
    516         fread(wordentry_buf, std::min(sizeof(wordentry_buf), page_size), 1, idxfile); //TODO: check returned values, deal with word entry that strlen>255.
     516        fread(wordentry_buf,
     517              std::min(sizeof(wordentry_buf), static_cast<size_t>(page_size)),
     518              1, idxfile);
     519        //TODO: check returned values, deal with word entry that strlen>255.
    517520        return wordentry_buf;
    518521}
    519522