Re: Error in act.wizard.c / *NEWBIE?* Help with whogroup command

From: Leeman Strout (leeman@redrose.net)
Date: 07/10/96


On Wed, 10 Jul 1996, Eduardo Gutierrez de Oliveira wrote:

> On Wed, 10 Jul 1996, Niese-Petersen wrote:
> 
> The lines are:
> 
> 1131:
>        strcpy(buf1, "%s is followed by:\n\r", GET_NAME(d->character));
> 1137:
>          strcpy(buf1, "%s%s", GET_NAME(f->follower), (!next ? "\n\r" : ", "));
> 
> I cannot find anything wrong with these, any ideas?

yes - strcpy doesn't work that way.. 

char *strcpy(s, ct)  -  copy string ct to string s, including '\0'; 
                        return s.


what you probably want to use is sprintf();

int sprintf(char *s, const char *format, ...)  -  sprintf is the same as
    printf except that the output is written into the string s, terminated
    with '\0'.  s must be big enough to hold the result.  The return 
    count does not include the '\0'.


This is what I use to get the same effect as what I assume you're 
shooting for.

Leeman
leeman@redrose.net



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