{
BOOL valid = TRUE;
- if ((end < str) || (end - str < strlen("%20")))
+ if ((end < str) || ((size_t)(end - str) < strlen("%20")))
return FALSE;
*value = 0;
* an accurate account of the current file offset and do not call
* lseek() if the client requests file content sequentially.
*/
- if (file->offset == offset)
+ if (offset > INT64_MAX)
+ return ERROR_SEEK;
+
+ if (file->offset == (INT64)offset)
return NO_ERROR;
WLog_VRB(TAG, "file %d force seeking to %"PRIu64", current %"PRIu64, file->fd,
offset, file->offset);
- if (lseek(file->fd, offset, SEEK_SET) < 0)
+ if (lseek(file->fd, (off_t)offset, SEEK_SET) < 0)
{
int err = errno;
WLog_ERR(TAG, "failed to seek file: %s", strerror(err));