InputStream: make offset_type unsigned

This commit is contained in:
Max Kellermann
2014-08-18 09:47:23 +02:00
parent dfa53cb88e
commit 181edf4b53
5 changed files with 5 additions and 14 deletions

@@ -101,13 +101,13 @@ input_file_open(const char *filename,
bool
FileInputStream::Seek(offset_type new_offset, Error &error)
{
new_offset = (offset_type)lseek(fd, (off_t)new_offset, SEEK_SET);
if (new_offset < 0) {
auto result = lseek(fd, (off_t)new_offset, SEEK_SET);
if (result < 0) {
error.SetErrno("Failed to seek");
return false;
}
offset = new_offset;
offset = (offset_type)result;
return true;
}