George's Buffer patch 18

From: Torgny Bjers (
Date: 03/24/02


I am running a CircleMUD bpl18 with MySQL on a Linux machine.  I just
attempted to put in the Buffer patch by George, and I have it working as far
as booting and running.  I changed so that it runs solely on the new buffers
only, and then of course I get errors, but I have an error in a macro, and
since memory allocation/free'ing is not my strong side, I could use some
help to adapt these macros to the new buffers.

The link to the patch is:

Here are my defines that I get trouble with:
#define    SQL_MALLOC(source, dest) ((dest) = (char *)malloc( (source) ?
strlen((source)) * 2 + 1 : 1 ));\
    if(!(source)) strcpy((dest), " ");
#define    SQL_ESC(source, dest) if(source) mysql_escape_string(dest,
source, strlen(source)); else dest[0]='\0'
#define    SQL_FREE(string) if(string) free(string);

The errors reported are:
BUF: SYSERR: detach_buffer: No buffer->data 0x82608f0 found for do_help:233.

The code where the error is in do_help:

    if (*searcharg)

If you need any help on the mysql_escape_string, you can find that in the
MySQL C API documentation at:

I would appreciate any help on this, since I am a complete moron when it
comes to memory handling of course, and know nothing of these things that I
meddle in. :)

Kindest Regards,

   | FAQ: |
   | Archives: |
   | Newbie List:   |

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