Re: [CODE] Verify function

From: James Turner (turnerjh@XTN.NET)
Date: 06/27/98


George <greerga@CIRCLEMUD.ORG> writes:

> Ok, make the function an 'int' returning 'c'.
>
>   c += verify_function(rnum, buf + c, MAX_STRING_LENGTH - c);
>
> With appropriate checks for 0 space left and such.

It still has a hackish look.  A nice buffered system like Erwin
proposed would be nice.  How well does buffer 1.8 work, and is there a
non-patch version available?

<rant> This reminds me.  Perhaps it's time we as a community stopped making
patches available?  Instead, some kind of file describing what to do?
Patches are a prime cause that we have so many boring semi-stock
muds.  Yes they're convenient, but on most muds, they're not usable
as-is and require hand patching.  Then we'd just end up with a bunch
of stock-only muds.  I dunno, I guess I'm just reacting to the large
about of extremely basic questions that are posed here. </rant>

A matter of personal opinion only, I prefer doing the sprintf stuff
this way.  Looks nicer, and it makes it easier to do non-sprintf stuff
at the end of the buffer.  Fundamentally the same, just using an extra
pointer instead of an int:

char *p = buf;

p += sprintf(p, ...);

IMO nicer than
int i;

i += sprintf(buf + i, ...);

To each his own :)

--
James Turner                turnerjh@xtn.net             UIN: 1102038
                            http://www.vuse.vanderbilt.edu/~turnerjh/


     +------------------------------------------------------------+
     | 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