Re: I was told this line of code would get me fired
- From: Måns Rullgård <mru@xxxxxxxxxxxxx>
- Date: Mon, 13 Mar 2006 18:50:58 +0000
Ralf Fassel <ralfixx@xxxxxx> writes:
* "Chad" <cdalten@xxxxxxxxx>
| I was told the follwing line of code:
|
| for(;fread(&log_file,sizeof(struct utmp),1,fp) !=0;)
|
| would have gotten me fired had I used this out in the workforce. Can
| someone clue me on what is going wrong here?
If the number of bytes read by fread() is less than the requested
number of bytes but greater than zero,
fread() will return 0.
the code will work on an incomplete utmp struct.
No, that's not the problem here.
--
Måns Rullgård
mru@xxxxxxxxxxxxx
.
- References:
- I was told this line of code would get me fired
- From: Chad
- Re: I was told this line of code would get me fired
- From: Ralf Fassel
- I was told this line of code would get me fired
- Prev by Date: what type should I cast?
- Next by Date: Re: I was told this line of code would get me fired
- Previous by thread: Re: I was told this line of code would get me fired
- Next by thread: Re: I was told this line of code would get me fired
- Index(es):
Relevant Pages
|