#include "ClientSocket.h"
#include "IOHandler.h"
#include "tools.h"
+#include "log.h"
#define MAXPENALTY 8 /* 4 messages */
static struct BotQueue *initialize_queue(struct ClientSocket *client) {
struct BotQueue *queue = malloc(sizeof(*queue));
if (!queue) {
- perror("malloc() failed");
+ printf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__);
return NULL;
}
queue->client = client;
} else {
struct QueueEntry *entry = malloc(sizeof(*entry));
if (!entry) {
- perror("malloc() failed");
+ printf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__);
return 0;
}
entry->msg = strdup(msg);