|
0 registered members (),
6,962
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: possible Bug in file_save (A7.82.3)
[Re: pegamode]
#305238
01/13/10 18:42
01/13/10 18:42
|
Joined: Feb 2006
Posts: 1,011 Germany
pegamode
OP
Serious User
|
OP
Serious User
Joined: Feb 2006
Posts: 1,011
Germany
|
Maybe a stupid question, but how can I check this?
Here's some explanations to the code above:
SAVEGAME is a struct and savegame an object of this struct type. I initialize savegame with:
SAVEGAME* savegame = (SAVEGAME*)(malloc(sizeof(SAVEGAME)));
Then I set all values for savegame and the call:
file_save(savename, savegame, sizeof(SAVEGAME));
I logged out:
sizeof(savegame) and sizeof(SAVEGAME)
but
sizeof(savegame) always returns 4 (just the size of the pointer) sizeof(SAVEGAME) always returns 231368 (that's what I expected)
So how could I check if savegame exceeds the size of SAVEGAME?
Regards, Pegamode.
Last edited by pegamode; 01/13/10 19:33.
|
|
|
Re: possible Bug in file_save (A7.82.3)
[Re: jcl]
#305327
01/14/10 08:34
01/14/10 08:34
|
Joined: Feb 2006
Posts: 1,011 Germany
pegamode
OP
Serious User
|
OP
Serious User
Joined: Feb 2006
Posts: 1,011
Germany
|
I'm quite sure. This is the code I use:
ediag(fctName, LEVEL_INFO, _str("saving savegame."));
var result = file_save(savename, savegame, sizeof(SAVEGAME));
if (result == NULL) {
error("filesave error");
}
ediag(fctName, LEVEL_INFO, _str("saved savegame."));
ediag is an extension to diag. In my logfile I see the following: [17:14:21] INFO [function save_game(STRING* savename)]: saving savegame. Error E1513: Crash in save_game "saved savegame." isn't logged out. So the error should either be in file_save or in the ediag after the file_save. ediag is used hundreds of times in the whole project without any problems, so it would make me wonder if there's a problem with this one, but I'll change it to a "normal" diag to check it out. The error occurs seldom and sporadically so it's not that easy to reproduce. Even if I load the savegame that was saved when the error occured and then save again directly after loading, the error doesn't occur. So it could time some time to reproduce it (hopefully I'll get it soon). Any other idea what it could be? Regards, Pegamode.
|
|
|
|