]> code.citadel.org Git - citadel.git/commitdiff
I am a C programmer. I am better than you.
authorArt Cancro <ajc@citadel.org>
Mon, 10 Apr 2023 18:58:11 +0000 (14:58 -0400)
committerArt Cancro <ajc@citadel.org>
Mon, 10 Apr 2023 18:58:11 +0000 (14:58 -0400)
citadel/utils/ctdl3264.c

index 60427af65b78c45bc8919f24d57cfd0e0faf2042..d4dfca40193fe08be48d4f573c3958c605ffe9b5 100644 (file)
@@ -151,6 +151,15 @@ void convert_msgmain(int which_cdb, DBT *in_key, DBT *in_data, DBT *out_key, DBT
 
        // If the msgnum is positive, we are looking at a MESSAGE
        else if (in_msgnum > 0) {
+               out_key->size = sizeof(long);
+               out_key->data = realloc(out_key->data, out_key->size);
+               out_msgnum = (long)in_msgnum;
+               memcpy(out_key->data, &out_msgnum, sizeof(long));
+
+               // copy the message verbatim
+               out_data->size = in_data->size;
+               out_data->data = realloc(out_data->data, out_data->size);
+               memcpy(out_data->data, in_data->data, out_data->size);
        }
 
        // If the msgnum is 0 it's probably not a valid record.