Space at the end of a string, fread()
#1

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:

Код:
		  new File:accname = fopen(nametxt, io_read);
		  
			new passwordtxt[20];
 			fread(accname, passwordtxt);
 			fclose(accname);
nametxt contains the name of the file that need to be opened.

If the file is:

Код:
password
adminfalse
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.
Reply


Messages In This Thread
Space at the end of a string, fread() - by pascallj - 19.06.2009, 16:24
Re: Space at the end of a string, fread() - by pascallj - 20.06.2009, 18:32
Re: Space at the end of a string, fread() - by Joe Staff - 20.06.2009, 19:52
Re: Space at the end of a string, fread() - by ledzep - 20.06.2009, 19:54
Re: Space at the end of a string, fread() - by pascallj - 21.06.2009, 10:21
Re: Space at the end of a string, fread() - by Andom - 21.06.2009, 15:12

Forum Jump:


Users browsing this thread: 1 Guest(s)