31.12.2012, 14:57
Two bugs regarding the file.inc in the SA-MP package:
1. fgetchar is not correctly "natived" in file.inc:
This should be:
This could be used like this:
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.
That will print "file position = 0", but if I do this:
Then it will put an X character at the 50th spot in the file.
1. fgetchar is not correctly "natived" in file.inc:
Код:
native fgetchar(File: handle, value, bool: utf8 = true);
Код:
native fgetchar(File: handle, bool: utf8 = true);
Код:
new character = fgetchar(file, false);
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);
Код:
fseek(file, 50, seek_start); fputchar(file, 'x', false);