Re: Date header

Ralph Corderoy <[email protected]>
Newsgroups gmane.network.sn
Message-ID <[email protected]>
Hi Patrik,

> --- ../sn-0.3.5/snsend.c        Thu May 23 01:15:16 2002
> +++ snsend.c    Tue Aug  6 01:25:56 2002
> @@ -773,7 +771,7 @@
>        memcpy(p, days[tmp->tm_wday], 3);
>        appendhead("Date: ", sizeof ("Date: ") - 1);
>        appendhead(p, strlen(p));
> -      appendhead(" GMT\r\n", 6);
> +      appendhead(" -0000\r\n", 6);
>        LOG3("added Date to article \"%s\"", messageid);
>     }

Assuming the second parameter is a byte count then it should have
changed from 6.

If there are a lot of appendhead() calls of either of the two forms

    appendhead(s, strlen(s));
    appendhead("const", sizeof("const") - 1);

then I'd strongly suggest creating a couple of preprocessor macros, e.g.

    #define appendheads(s) appendhead((s), strlen(s));
    #define appendheadc(s) appendhead((s), sizeof(s) - 1);

as otherwise you're left counting characters in string constants, which
I haven't done since Hollerith constants, or having the same string,
hopefully, present twice in the one line.  Either a recipe for bugs.

Cheers,


Ralph.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.