On Sat, Nov 10, 2001 at 03:07:22PM -0600, Tom Whiting wrote:
> Okie, I'm at a bit of a loss here
> 
> In struct pc_data
> CHAR_DATA             spouse;
>    if (ch->pcdata->spouse)
>    { 
>         sprintf(buf,"I don't think %s would like that very much\n\r",
> ch->pcdata->spouse); 
> // Here I've got an invalid pointer?? Char format but CHAR_DATA arg????
> .. I really really don't get this...

Well, %s expects a pointer to a character, and you're feeding it
a structure. I would suggest that you...

... replace CHAR_DATA spouse; with CHAR_DATA *spouse so you can actually
    do "if (ch->pcdata->spouse!=NULL)" as a real test :-)
... check that you proper initialize spouse in new_pc_data()
... make sure you str_dup() your strings instead of assign them (damned,
    this start to sound like somebody who never did any C programming).
... compile your stuff with -Wall, because I think your assignments should
    be complained about:
    > victim->pcdata->tspouse = ch->name ;
    > ch->pcdata->tspouse = victim->name ;
... etc.


Edwin

-- 
Edwin Groothuis   |              Personal website: http://www.MavEtJu.org
[EMAIL PROTECTED] |           Interested in MUDs? Visit Fatal Dimensions:
------------------+                       http://www.FatalDimensions.org/

Reply via email to