Commit 1cc7ff5c authored by Pekka Pessi's avatar Pekka Pessi

msg_mclass.c: added checks for already inserted headers.

- msg_mclass_insert_header()
- msg_mclass_insert_with_mask()

darcs-hash:20061207172642-65a35-de57287e25cf05a5d00d7dde78b1fd8215bcb8ba.gz
parent 1f8f8000
......@@ -165,11 +165,14 @@ int msg_mclass_insert_header(msg_mclass_t *mc,
{
msg_href_t hr[1];
if (mc == NULL) {
if (mc == NULL || hc == NULL) {
errno = EINVAL;
return -1;
}
if (msg_hclass_offset(mc, NULL, hc))
return (void)(errno = EEXISTS), -1;
if (offset == 0)
offset = mc->mc_msize, mc->mc_msize += sizeof(msg_header_t *);
......@@ -205,11 +208,14 @@ int msg_mclass_insert_with_mask(msg_mclass_t *mc,
{
msg_href_t hr[1];
if (mc == NULL) {
if (mc == NULL || hc == NULL) {
errno = EINVAL;
return -1;
}
if (msg_hclass_offset(mc, NULL, hc))
return (void)(errno = EEXISTS), -1;
if (offset == 0)
offset = mc->mc_msize, mc->mc_msize += sizeof(msg_header_t *);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment