bzero

From: Shane P. Lee (tacodog21@yahoo.com)
Date: 09/03/02


I'm curious as to why I have never seen bzero used in CircleMUD.
I recently discovered the usefulness of it and it helped me deal
with a nagging issue on a personal project.
Even if it's not compatible with many platforms, it's a great
function and could easily be duplicated for systems that don't
already have it defined in string.h.
It seems much safer than free, at least as far as I can tell, so
why wouldn't it be more widely used? For those who aren't sure what
it is, here's a quick rundown (in my own terms);

bzero(buf, sizeof(buf));
writes 0 bytes to the first argument for every instance of the second.

For a closer look, check out:
http://www.opengroup.org/onlinepubs/007908799/xsh/bzero.html

That page recommends that the function 'memset' be used instead,
check the link at the bottom for its reference.
Call me a horrible coder for not checking each option available to
me if you want, but I haven't fully looked into the advantages of
memset over bzero.

ANYWAY, back to the CircleMUD issue: Is there a particular reason
I haven't seen it used in stock circle? Could there be some monster
waiting in the background ready to eat my function because I used
bzero? Is there some sort of memory issue at stake? Because bzero
seems to be very memory-friendly. The array still exists in it's
original shape, it's just empty and waiting for new input.

-FIRE

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT