[Freeciv-Dev] Re: [PATCH] Buglet in server/savegame.c
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sun, Oct 14, 2001 at 08:40:50PM +0100, Gaute B Strokkenes wrote:
>
> I just spotted the following while going through some of Jason's
> recent changes (though the bug is not Jason's).
>
> strchr() has a misfeature in that if the character you are looking for
> is 0, then it will return a pointer to the string's terminating NUL.
> This causes us to do wrong things in the savegame loading code.
> As an aside, I believe that PR 974 may be related to this bug, but I
> do not have time to investigate.
Yes this would catch the error a bit earlier in teh loading. Still
unknown is what caused it in the first place. I have thought about
doing:
for (y = 0; y < map.ysize; y++) { \
for (x = 0; x < map.xsize; x++) { \
if (is_normal_map_pos(x, y)) { \
line[x] = get_xy_char; \
+ assert(line[x]!='\0');
} else { \
/* skipped over in loading */ \
line[x] = '#'; \
} \
} \
So far I haven't implemented it. Comments?
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
Q: Do you know what the death rate around here is?
A: One per person.
|
|