Re: [CODE] [Newbie] format arguments, %d vs. %s.

From: Ron Cole (rcole@ezy.net)
Date: 11/14/98


>Alright, here's the problem... I generally had the %d below as a %s, but that
>would error ( warning: format argument is not a pointer (arg 3) ) , and crash
>the mud if anybody ever Look'ed into a room.
>
>In act.informative.c...
>  if (AFF_FLAGGED(i, AFF_PAINTBALL)) {
>  sprintf(buf2,"...is covered in %d's paintballs!\r\n",GET_PAINTBALL(i));
>    send_to_char(buf2, ch);
>
>So I replaced it with a %d, and now I get a number:
>Catherine the Grape is standing here.
>...is covered in 136's paintballs!

What is the value?  Is it a char_data pointer? (bad idea, they get extracted)
Or, is it a player id number?  If so, you need to call get_name_by_id() to
retrieve the name.

Ron


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST