On Fri, Jul 6, 2007, Paul J Stevens <[EMAIL PROTECTED]> said:

> Aaron Stone wrote:
>> On Thu, 2007-07-05 at 18:16 +0000, Aaron Stone wrote:
>>> On Thu, Jul 5, 2007, Anton Zakatov <[EMAIL PROTECTED]> said:
>>>
>>>> Hello!
>>>> I find some problems with send_alert:
>>>> 1.  wrong size of msgflags in memset
>>>> 2. dbmail_message_construct dont call _map_headers => header cache not 
>>>> inserted into db on store
>>>>
>>>> With best regards, Anton Zakatov.  E-mail: [EMAIL PROTECTED] 
>>> Oh, that's great! I'd seen an error once in valgrind about overrunning the
>>> msgflags structure by 1, but could not pinpoint where it was coming from.
>>> Looks like this might be it.
>> 
>> Nope, couldn't have been that valgrind issue I once saw, since we were
>> well under-memset-ing, not overrunning anything. Anyhow, good catch,
>> thank you.
> 
> Sorry to be dense here, but would this be better? :
> 
> #define NFLAGS 5
> 
> int msgflags[NFLAGS];
> memset(msgflags,0,NFLAGS*sizeof(int));

Was I staring at the code but using the wrong constant?

> or maybe even better (per convention in several gnu manpages):
> 
> memset(msgflags,0,sizeof(msgflags));

Sure, that's fine.

>> Paul, should dbmail-message.c: dbmail_construct_message call map_headers
>> just as dbmail_message_init_with_string and
>> dbmail_message_init_with_stream do?
> 
> That is a matter of consistency, and only relevant for people who are
> using libdbmail to brew their own tools. Afaik, dbmail_construct_message
> is currently used only to send messages out, *not* store them or do
> anything that requires access to the message's headers.

pipe.c: send_alert does.

Aaron
_______________________________________________
Dbmail-dev mailing list
[email protected]
http://twister.fastxs.net/mailman/listinfo/dbmail-dev

Reply via email to