/* attaches a message to the end of the message chain */
void message_put(struct lcr_msg *message)
{
- if (message->id_to == 0)
- {
+ if (message->id_to == 0) {
PDEBUG(DEBUG_MSG, "message %s not written, because destination is 0.\n", messages_txt[message->type]);
message_free(message);
return;
*messagepointer_end = message;
messagepointer_end = &(message->next);
+ /* Nullify next pointer if recycled messages */
+ *messagepointer_end=NULL;
}
struct lcr_msg *message_forward(int id_from, int id_to, int flow, union parameter *param)
struct lcr_msg *message;
if (!message_first)
- {
return(0);
- }
message = message_first;
message_first = message->next;