Its not really a problem you can fix, persay. As in, getting it to work your
way would be... uhh interesting? But, I was pondering over this and so I
talked to one of my Guru's to get an explination. And, now, with sprintf it
does the last in first out thing, right? So the second one is process first,
then the first. They are both pointing to the same static buffer, which is
why you get the resaults you do. Not much you can do with this, except,
maybe have it return strdup(new_buf); but then you'd have to free it to save
a massive memory leak. Eg.
char *tmp, *tmp2;
tmp = fnum(ch->steal);
tmp2 = fnum(ch->gold);
sprintf(buf, "%s %s\n\r", tmp, tmp2);
Now, that doesn't really save time, or lines. You can also (Without mods)
int len;
len = sprintf(buf, "%s", fnum(ch->steal) );
sprintf(buf+len, "%s", fnum(ch->gold) );
Thats alittle better :), but, this is all I can throw up right now. Sorry if
the function names are alittle off, but I deleted your post acsodently and
can't find recient archives.
Davion
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca