Mail Archives: djgpp-workers/2000/01/16/09:28:09
On Sun, 16 Jan 100, Martin Str|mberg wrote:
> Here's my solution:
Thanks. A picture is worth about a thousand words, they say ;-)
> /* We convert SEEK_CUR and SEEK_END to SEEK_SET. */
> if( whence == SEEK_CUR || whence == SEEK_END )
> {
> position = ll_llseek( handle, 0, whence );
If whence == SEEK_CUR and offset is positive, you could avoid the double
call, no?
> if( whence == SEEK_SET )
> {
> if( offset < 0 )
> {
> offset = 0;
> }
> else if( MAX_FILE_POINTER_POSITION < offset )
> {
> offset = MAX_FILE_POINTER_POSITION;
> }
> }
What happens if you pass the offset unaltered to DOS? Why should we
silently change the arguments, unless they somehow crash the system or
wipe the disk?
- Raw text -