[Freeciv-Dev] Re: (PR#6244) advdiplomacy valgrind warning
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Jason Short wrote:
> [jdorje - Mon Sep 22 15:10:17 2003]:
>
>
>>==27224== Conditional jump or move depends on uninitialised value(s)
>>==27224== at 0x403D16CF: _IO_vfprintf_internal (in /lib/libc-
>>2.3.2.so)
>>==27224== by 0x403F01E9: _IO_vsnprintf (in /lib/libc-2.3.2.so)
>>==27224== by 0x804C376: my_vsnprintf (support.c:327)
>>==27224== by 0x807E091: vnotify_conn_ex (plrhand.c:1052)
>>==27224== by 0x807E253: notify_player_ex (plrhand.c:1116)
>>==27224== by 0x80C1CA3: notify (advdiplomacy.c:93)
>
>
> While playing a real game (with some patches) I get the message (in the
> gui-gtk meswin):
>
> *D XX (AI)* First break alliance with XXXXXXXXX XXXXXXXX3X0XXXX, XXX"
>
> where all of the X characters are garbage.
>
> So I guess this is a real bug...
And naturally, it is a really stupid one.
jason
? rc
Index: ai/advdiplomacy.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdiplomacy.c,v
retrieving revision 1.6
diff -u -r1.6 advdiplomacy.c
--- ai/advdiplomacy.c 2003/09/22 15:50:54 1.6
+++ ai/advdiplomacy.c 2003/09/22 19:46:49
@@ -88,9 +88,10 @@
{
if (diplomacy_verbose) {
va_list ap;
+ struct conn_list *dest = (struct conn_list*)&pplayer->connections;
va_start(ap, text);
- notify_player_ex(pplayer, -1, -1, E_DIPLOMACY, text, ap);
+ vnotify_conn_ex(dest, -1, -1, E_DIPLOMACY, text, ap);
va_end(ap);
}
}
Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.293
diff -u -r1.293 plrhand.c
--- server/plrhand.c 2003/09/15 16:51:07 1.293
+++ server/plrhand.c 2003/09/22 19:46:49
@@ -1044,8 +1044,8 @@
coordinates have been normalized. For generic event use E_NOEVENT.
(But current clients do not use (x,y) data for E_NOEVENT events.)
**************************************************************************/
-static void vnotify_conn_ex(struct conn_list *dest, int x, int y, int event,
- const char *format, va_list vargs)
+void vnotify_conn_ex(struct conn_list *dest, int x, int y, int event,
+ const char *format, va_list vargs)
{
struct packet_generic_message genmsg;
Index: server/plrhand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.h,v
retrieving revision 1.56
diff -u -r1.56 plrhand.h
--- server/plrhand.h 2003/08/09 15:34:19 1.56
+++ server/plrhand.h 2003/09/22 19:46:49
@@ -47,6 +47,8 @@
void notify_conn_ex(struct conn_list *dest, int x, int y, int event,
const char *format, ...)
fc__attribute((format (printf, 5, 6)));
+void vnotify_conn_ex(struct conn_list *dest, int x, int y, int event,
+ const char *format, va_list vargs);
void notify_conn(struct conn_list *dest, const char *format, ...)
fc__attribute((format (printf, 2, 3)));
void notify_player_ex(const struct player *pplayer, int x, int y,
|
|