13 Mar, 2010, yamtara wrote in the 1st comment:
Votes: 0
i have a mistake in this code but i cant find wahts wrong in game if i write quest list game down any one can see my mistake
i combined gcc4.x.

if (!strcmp(arg1, "list"))
{
act( "$n asks $N for a list of quest items.", ch, NULL, questman, TO_ROOM);
act ("You ask $N for a list of quest items.",ch, NULL, questman, TO_CHAR);

bufvampire[0] = '\0';
if ( ch->class == CLASS_VAMPIRE )
sprintf(bufvampire," 50qp………Vampire skill (vampire)\n\r");
bufsamurai[0] = '\0';
if ( ch->class == 9 )
sprintf(bufsamurai,"%s%s%s",
" 100qp………Katana quest (katana)\n\r",
" 100qp………Second katana quest(sharp)\n\r",
" 50qp………Decrease number of death (death)\n\r");
sprintf(buf, "Current Quest Items available for Purchase:\n\r\
5000qp………the silk-adamantite backpack (backpack)\n\r\
1000qp………the Girth of Real Heroism (girth)\n\r\
1000qp………the Ring of Real Heroism (ring)\n\r\
1000qp………the Real Hero's Weapon (weapon)\n\r\
1000qp………100 Practices (practice)\n\r\
500qp………Decanter of Endless Water (decanter)\n\r\
500qp………350,000 gold pieces (gold)\n\r\
250qp………1 constitution (con)\n\r\
200qp………tattoo of your religion (tattoo)\n\r%s%s\
50qp………remove tattoo of your religion (remove)\n\r\
50qp………set religion to none (set)\n\r\
To buy an item, type 'QUEST BUY <item>'.\n\r",
bufsamurai, bufvampire);
send_to_char(buf, ch);
return;
}



i thing in here there is a mistake sprintf(buf, "Current Quest Items available for Purchase:\n\r\
13 Mar, 2010, jurdendurden wrote in the 2nd comment:
Votes: 0
This line, where you add the vampire/samurai bufs to the main buf, looks odd… I think this last backslash isn't necessary… though I'm not sure that it would crash the game…

200qp………tattoo of your religion (tattoo)\n\r%s%s\
13 Mar, 2010, yamtara wrote in the 3rd comment:
Votes: 0
sprintf(buf, "Current Quest Items available for Purchase:\n\r\




i thing in here there is a mistake
13 Mar, 2010, yamtara wrote in the 4th comment:
Votes: 0
here is the error and i cant find whats wrong whit this


quest.c:223: error: missing terminating " character
quest.c:235: error: To undeclared (first use in this function)
quest.c:235: error: (Each undeclared identifier is reported only once
quest.c:235: error: for each function it appears in.)
quest.c:235: error: expected ) before buy
quest.c:235:22: warning: character constant too long for its type
quest.c:235: error: stray \ in program
quest.c:235: error: stray \ in program
quest.c:235:45: warning: missing terminating " character
quest.c:235: error: missing terminating " character
quest.c:236: warning: format not a string literal and no format arguments


here is the kod

214 bufvampire[0] = '\0';
215 if ( ch->class == CLASS_VAMPIRE )
216 sprintf(bufvampire," 50qp………Vampire skill (vampire)\n\r");
217 bufsamurai[0] = '\0';
218 if ( ch->class == 9 )
219 sprintf(bufsamurai,"%s%s%s",
220 " 100qp………Katana quest (katana)\n\r",
221 " 100qp………Second katana quest(sharp)\n\r",
222 " 50qp………Decrease number of death (death)\n\r");
223 sprintf(buf, "Current Quest Items available for Purchase:\n\r\
224 5000qp………the silk-adamantite backpack (backpack)\n\r\
225 1000qp………the Girth of Real Heroism (girth)\n\r\
226 1000qp………the Ring of Real Heroism (ring)\n\r\
227 1000qp………the Real Hero's Weapon (weapon)\n\r\
228 1000qp………100 Practices (practice)\n\r\
229 500qp………Decanter of Endless Water (decanter)\n\r\
230 500qp………350,000 gold pieces (gold)\n\r\
231 250qp………1 constitution (con)\n\r\
232 200qp………tattoo of your religion (tattoo)\n\r%s%s\
233 50qp………remove tattoo of your religion (remove)\n\r\
234 50qp………set religion to none (set)\n\r
235 To buy an item, type 'QUEST BUY <item>'.\n\r",
236 bufsamurai, bufvampire);
237 send_to_char(buf, ch);
238 return;
13 Mar, 2010, Runter wrote in the 5th comment:
Votes: 0
Maybe line 234 is missing the \ at the end of it. It's possible it also doesn't like this notation for multiple line format any longer.
13 Mar, 2010, yamtara wrote in the 6th comment:
Votes: 0
i did \ it combine but in game when i write quest list game terminate

<Yakuza: 1703hp 2245m 2270mv Opp:<None!>> q list
*** buffer overflow detected ***: ../src/anatolia terminated

there is a code error but i cand fine it yet.. trying to find.
13 Mar, 2010, Runter wrote in the 7th comment:
Votes: 0
It means you need to increase the size of a variable somewhere. It's probably called MAX_BUFFER or some such. It's probably in mud.h or merc.h or whatever.h your game is using for those.v

It also may be increasing MAX_STRING_LENGTH. Honestly, not sure with this arcane codebase. :p
0.0/7