The availability of socketbits.h?

Dan Nelson dnelson at allantgroup.com
Tue May 17 20:38:11 PDT 2005


In the last episode (May 18), Xu Qiang said:
> Dan Nelson wrote:
> > That for loop should really read:
> > 
> >   for(i=0; i<command_count; i++) {
> > 
> > , since command_count should already be set to
> > COUNTOF(command_list) by a previous call to command_init().
> 
> Thank you, Dan. Your fix works!
> 
> Still, I wonder why the fix of Giorgos doesn't work, because it seems
> quite right to me, too.

The rest of the code in command.c makes use of the command_count value
and assumes that all the array elements are fully populated.  The qsort
routime tried to compare a NULL comm_name value and seg faulted.  His
fix would have worked if the rest of the program used the same code
loop as the one at command.c:1149, but it doesn't.
 
> (Btw, I can't understand why this software has so many bugs to be
> fixed before it can be compiled and run successfully. The developers
> don't check their product before shipping out? I have compiled and
> installed quite a number of GNU softwares, never saw such a buggy
> one. Yet, I am a go game lover, and want to set up a local NNGS
> server. And this is the only available open source go server software
> in the world. Alas!)

The author may not have tested it on many systems, and since the source
is so old (relatively speaking), standards have changed.  It's no
longer acceptable to provide your own prototypes for system functions,
for example (which was the cause of your first few compile errors).

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-questions mailing list