Fix #211: getMimeTypeForFile does not handle files without extensions correctly

Use `auto` instead of `unsigned int` to ensure proper size on 64-bit platforms
This commit is contained in:
Pavel Minaev 2018-08-02 18:19:29 -07:00
parent 0785636ca5
commit 221f3ef340

View File

@ -130,7 +130,7 @@ get_from_humanReadableBookId(const std::string& humanReadableBookId) {
static std::string getMimeTypeForFile(const std::string& filename)
{
std::string mimeType = "text/plain";
unsigned int pos = filename.find_last_of(".");
auto pos = filename.find_last_of(".");
if (pos != std::string::npos) {
std::string extension = filename.substr(pos + 1);