(trunk) fix a nasty width truncation bug, reported by Eric in http://transmission.m0k.org/forum/viewtopic.php?t=2304&start=16
This commit is contained in:
parent
3cd185747c
commit
4b980c4c36
|
@ -125,7 +125,7 @@ ensureMinimumFileSize ( const tr_torrent_t * tor,
|
||||||
ret = fd;
|
ret = fd;
|
||||||
else if (fstat (fd, &sb) ) /* how big is the file? */
|
else if (fstat (fd, &sb) ) /* how big is the file? */
|
||||||
ret = tr_ioErrorFromErrno ();
|
ret = tr_ioErrorFromErrno ();
|
||||||
else if ((size_t)sb.st_size >= minSize) /* already big enough */
|
else if (sb.st_size >= (off_t)minSize) /* already big enough */
|
||||||
ret = TR_OK;
|
ret = TR_OK;
|
||||||
else if (!ftruncate( fd, minSize )) /* grow it */
|
else if (!ftruncate( fd, minSize )) /* grow it */
|
||||||
ret = TR_OK;
|
ret = TR_OK;
|
||||||
|
|
Loading…
Reference in New Issue