#include "DBHelper.h"
#include "mysqlConn.h"
#include "tools.h"
+#include "log.h"
#define DEFAULT_LANG_TAG "EN"
#define DEFAULT_LANG_NAME "English"
if(cindex == MAXLANGUAGES) return NULL;
struct language *lang = malloc(sizeof(*lang));
if (!lang) {
- perror("malloc() failed");
+ printf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__);
return NULL;
}
lang->langtag = strdup(langtag);
if(!lang_entry) {
lang_entry = malloc(sizeof(*lang_entry));
if (!lang_entry) {
- perror("malloc() failed");
+ printf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__);
return;
}
lang_entry->ident = strdup(ident);
if(buffer == NULL) {
buffer = (char *)malloc((MAXLEN+1) * sizeof(char));
if (!buffer) {
- perror("malloc() failed");
+ printf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__);
return NULL;
}
}