[Freeciv-Dev] Patch: city report crashes client
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Here is a patch for a bug in the client. This bug would sometimes
cause the client to crash with a segmentation violation if you
requested the city report and had built or otherwise acquired many
cities since the last time you requested the report.
The patch is against the March 16 CVS snapshot.
Pat
--
patsmith@xxxxxxxxx --- client/cityrep.c.orig Thu Mar 4 06:34:09 1999
+++ client/cityrep.c Wed Mar 24 23:24:25 1999
@@ -713,7 +713,8 @@
if(n_alloc == 0 || n > n_alloc) {
int j, n_prev = n_alloc;
- if(!n_alloc) n_alloc=n+1; else n_alloc *= 2;
+ n_alloc *= 2;
+ if (!n_alloc || n_alloc < n) n_alloc = n + 1;
freelog(LOG_DEBUG, "city report n_alloc increased to %d", n_alloc);
cities_in_list = realloc(cities_in_list,
n_alloc*sizeof(*cities_in_list));
city_list_text = realloc(city_list_text, n_alloc*sizeof(char*));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] Patch: city report crashes client,
Patrick Smith <=
|
|