]> code.citadel.org Git - citadel.git/blobdiff - citadel/msgbase.c
* Discovered that my system hasn't processed its refcount_adjustments queue in about...
[citadel.git] / citadel / msgbase.c
index ccee9818d2574549e63cd821cc49a1a3c0ff6ade..87a01d63cf8e7a583483ad34e03c314c9d4f2cbf 100644 (file)
@@ -1517,12 +1517,12 @@ char *qp_encode_email_addrs(char *source)
        EncodedMaxLen = nColons * (sizeof(headerStr) + 3) + SourceLen * 3;
        Encoded = (char*) malloc (EncodedMaxLen);
 
-       for (i = 1; i <= nColons; i++)
+       for (i = 0; i < nColons; i++)
                source[AddrPtr[i]++] = '\0';
 
        nPtr = Encoded;
        *nPtr = '\0';
-       for (i = 0; i <= nColons && nPtr != NULL; i++) {
+       for (i = 0; i < nColons && nPtr != NULL; i++) {
                nmax = EncodedMaxLen - (nPtr - Encoded);
                if (AddrUtf8[i]) {
                        process_rfc822_addr(&source[AddrPtr[i]], 
@@ -1560,7 +1560,7 @@ char *qp_encode_email_addrs(char *source)
                        i--; /* do it once more with properly lengthened buffer */
                }
        }
-       for (i = 1; i <= nColons; i++)
+       for (i = 0; i < nColons; i++)
                source[--AddrPtr[i]] = ',';
        free(AddrUtf8);
        free(AddrPtr);
@@ -1776,6 +1776,9 @@ int CtdlOutputPreLoadedMsg(
                                else if (i == 'P') {
                                        cprintf("Return-Path: %s%s", mptr, nl);
                                }
+                               else if (i == 'L') {
+                                       cprintf("List-ID: %s%s", mptr, nl);
+                               }
                                else if (i == 'V') {
                                        if ((flags & QP_EADDR) != 0) 
                                                mptr = qp_encode_email_addrs(mptr);
@@ -4331,7 +4334,7 @@ int TDAP_ProcessAdjRefCountQueue(void)
        struct arcq arcq_rec;
        int num_records_processed = 0;
 
-       snprintf(file_arcq_temp, sizeof file_arcq_temp, "%s2", file_arcq);
+       snprintf(file_arcq_temp, sizeof file_arcq_temp, "%s.%04x", file_arcq, rand());
 
        begin_critical_section(S_SUPPMSGMAIN);
        if (arcfp != NULL) {
@@ -4394,7 +4397,7 @@ void TDAP_AdjRefCount(long msgnum, int incr)
        smi.meta_refcount += incr;
        PutMetaData(&smi);
        end_critical_section(S_SUPPMSGMAIN);
-       CtdlLogPrintf(CTDL_DEBUG, "msg %ld ref count delta %d, is now %d\n",
+       CtdlLogPrintf(CTDL_DEBUG, "msg %ld ref count delta %+d, is now %d\n",
                msgnum, incr, smi.meta_refcount);
 
        /* If the reference count is now zero, delete the message