Fgetchar & Fseek
#1

Two bugs regarding the file.inc in the SA-MP package:

1. fgetchar is not correctly "natived" in file.inc:
Код:
native fgetchar(File: handle, value, bool: utf8 = true);
This should be:
Код:
native fgetchar(File: handle, bool: utf8 = true);
This could be used like this:
Код:
new character = fgetchar(file, false);
Source, fgetchar worked properly after using the new version.



2. fseek doesn't return any number, it always returns 0, even when the file has the required amount of characters. But the new file location is set.
Код:
new pos = fseek(file, 50, seek_start);
printf("file position = %i", pos);
That will print "file position = 0", but if I do this:
Код:
fseek(file, 50, seek_start);
fputchar(file, 'x', false);
Then it will put an X character at the 50th spot in the file.
Reply


Messages In This Thread
Fgetchar & Fseek - by Basssiiie - 31.12.2012, 14:57
Re: Fgetchar & Fseek - by mastermax7777 - 01.01.2013, 01:32
Re: Fgetchar & Fseek - by Basssiiie - 01.01.2013, 12:27
Re: Fgetchar & Fseek - by mineralo - 01.01.2013, 12:55

Forum Jump:


Users browsing this thread: 1 Guest(s)