Re: problem manipulating strings

From: Steve (quickey@cyberverse.com)
Date: 08/02/95


On Tue, 1 Aug 1995, Pink Floyd wrote:

> void set_title(struct char_data * ch, char *title)
> {
>   if (title == NULL) {
>     title = READ_TITLE(ch);
>     if ((GET_CLASS(ch) == CLASS_PALADIN) && (GET_LEVEL(ch) == 10)
>      /* this next line causes the Segmentation fault */
>       strcat(title, "some string");
i'm not a "rocket scientist" at C but i dont think strcat will work for 
this. if the pointer is null (there is no data inteh string) then you 
cant ADD to it. you would want to use:
   strcpy(title, "some string");
and then if you want to append to title, use strcat



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