Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2006:
[Freeciv-Dev] Re: Fw: common/nation.c compile warning
Home

[Freeciv-Dev] Re: Fw: common/nation.c compile warning

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Fw: common/nation.c compile warning
From: Egor Vyscrebentsov <evyscr@xxxxxxxxx>
Date: Fri, 24 Mar 2006 01:01:53 +0300

On Thu, 23 Mar 2006 23:49:48 +0300
Egor Vyscrebentsov wrote:

> svn trunk r11793
> 
> $ make
> ...
> freeciv/common/nation.c: In function `add_new_nation_group':
> freeciv/common/nation.c:351: warning: 'group' might be used
> uninitialized in this function
> make[4]: *** [nation.o] Error 1
>
> and the code in nation.c:351 (add_new_nation_group) was not understood
> by me:
>
>   struct nation_group *group;
> 
>   if (strlen(name) >= ARRAY_SIZE(group->name)) {
>     freelog(LOG_FATAL, "Too-long group name %s.", group->name);
>     exit(EXIT_FAILURE);
>   }

This seems to be a typo in freelog: 'name' should be used rather than
'group->name'

-- 
Thanks, evyscr

Attachment: nation_group.diff
Description: Text Data


[Prev in Thread] Current Thread [Next in Thread]