| delorie.com/archives/browse.cgi | search |
| Date: | Sun, 2 May 1999 20:14:54 -0400 |
| Message-Id: | <199905030014.UAA11309@envy.delorie.com> |
| From: | DJ Delorie <dj AT delorie DOT com> |
| To: | djgpp AT delorie DOT com |
| In-reply-to: | <7gikpt$k2i$1@nnrp1.dejanews.com> (benvg@hotpop.com) |
| Subject: | Re: fseek()/ fread() troubles |
| References: | <7gikpt$k2i$1 AT nnrp1 DOT dejanews DOT com> |
| Reply-To: | djgpp AT delorie DOT com |
| X-Mailing-List: | djgpp AT delorie DOT com |
| X-Unsubscribes-To: | listserv AT delorie DOT com |
This one stumped me for a while too - it fails under Linux. I caught
the error when I switched to lseek, which gave a suitable error
message.
> fseek_ret = fseek(fp, SEEK_SET, rand_num * 20);
Should be:
fseek_ret = fseek(fp, rand_num * 20, SEEK_SET);
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |