Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
fread returns more than i want
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="=?ISO-8859-1?Q?Bj=F8rn_Augestad?=, post: 2438997"] I'm guessing here, as you didn't provide a complete program. fread() does not terminate the buffer with a string terminator, so when you strcpy() of fprintf(), you copy/write more characters than expected. BTW, fprintf(stdout, buf) is a really bad idea, fprintf(stdout, "%s", buf) is much better. HTH Bjørn [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
fread returns more than i want
Top