We are going to want to reuse this.
No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
return True;
}
- if (priomsg_update_p(whynot, comm_notify_whynot_general))
- truncmsg_add_string(&whynot->m,
- "not MSG1 or PROD; unknown dest index");
+ priomsg_update_fixed(whynot, comm_notify_whynot_general,
+ "not MSG1 or PROD; unknown dest index");
return False;
}
return defmsg;
}
+bool_t priomsg_update_fixed(struct priomsg *pm, int prio, const char *m) {
+ if (!priomsg_update_p(pm, prio)) return False;
+ truncmsg_add_string(&pm->m, m);
+ return True;
+}
void buffer_new(struct buffer_if *buf, int32_t len)
{
/* return value is null-terminated, valid until next call
* or until defmsg is no longer valid ZM */
+bool_t priomsg_update_fixed(struct priomsg *pm, int prio, const char *m);
+ /* convenience combination of _update_p and truncmsg_add_string */
+
/*
* void BUF_ADD_BYTES(append, struct buffer_if*, const void*, int32_t size);
* void BUF_ADD_BYTES(prepend, struct buffer_if*, const void*, int32_t size);