RE: Buf Switches / Memory

From: Daniel Koepke (dkoepke@california.com)
Date: 02/28/97


On Fri, 28 Feb 1997, Gary Barnett wrote:

> Here's my vwear_object.. It's hardly efficient, but it solved the overflow problem
> With only a few minutes of coding effort.

Here's an idea...only send it out when the buffer is near full, then
purge the buffer and keep going...

>   *buf2 = '\0';
>   for (nr = 0; nr <= top_of_objt; nr++) {
>     obj = read_object(obj_index[nr].virtual, VIRTUAL);
>     if (CAN_WEAR(obj, wearpos)) {
>        sprintf(buf, "%3d. [%5d] %s\r\n", ++found,
>        obj_index[nr].virtual, obj_proto[nr].short_description);

Just kind of end it like...

         strcat(buf2, buf);
         if (strlen(buf2) > MAX_STRING_LENGTH-64) {
           page_string(ch->desc, buf2, 0);
           *buf2 = '\0';
         }
       }
       extract_obj(obj);
     }

That being mailer code...


--
Daniel Koepke
dkoepke@california.com
Forgive me father, for I am sin.


+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
|    Or send 'info circle' to majordomo@cspo.queensu.ca     |
+-----------------------------------------------------------+



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