19.06.2009, 16:24
Hello Everybody,
I am making my own server and everything is going well.
But now I've got a problem.
When I read the first line of a file with fread, it places a space at the end of the string.
This is my code:
nametxt contains the name of the file that need to be opened.
If the file is:
passwordtxt is: "password " <- with a space at the end.
I hope anyone can explain the problem and help me.
Greetz,
Pascal
p.s. Sorry for my bad English, but I'm Dutch.
I am making my own server and everything is going well.
But now I've got a problem.
When I read the first line of a file with fread, it places a space at the end of the string.
This is my code:
Код:
new File:accname = fopen(nametxt, io_read); new passwordtxt[20]; fread(accname, passwordtxt); fclose(accname);
If the file is:
Код:
password adminfalse
I hope anyone can explain the problem and help me.
Greetz,
Pascal
p.s. Sorry for my bad English, but I'm Dutch.