projects
/
NeonServV5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'origin/development'
[NeonServV5.git]
/
src
/
lang.c
diff --git
a/src/lang.c
b/src/lang.c
index 22b0c77c24c9f468855f7bd870b3f455016a6ba6..7d1532bf424bd7003cca2560c4da19ef26e1f0c2 100644
(file)
--- a/
src/lang.c
+++ b/
src/lang.c
@@
-19,6
+19,7
@@
#include "DBHelper.h"
#include "mysqlConn.h"
#include "tools.h"
#include "DBHelper.h"
#include "mysqlConn.h"
#include "tools.h"
+#include "log.h"
#define DEFAULT_LANG_TAG "EN"
#define DEFAULT_LANG_NAME "English"
#define DEFAULT_LANG_TAG "EN"
#define DEFAULT_LANG_NAME "English"
@@
-54,7
+55,7
@@
static struct language* add_language(char *langtag, char *langname) {
if(cindex == MAXLANGUAGES) return NULL;
struct language *lang = malloc(sizeof(*lang));
if (!lang) {
if(cindex == MAXLANGUAGES) return NULL;
struct language *lang = malloc(sizeof(*lang));
if (!lang) {
- p
error("malloc() failed"
);
+ p
rintf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__
);
return NULL;
}
lang->langtag = strdup(langtag);
return NULL;
}
lang->langtag = strdup(langtag);
@@
-143,7
+144,7
@@
void register_language_string(struct language *lang, char *ident, char *text) {
if(!lang_entry) {
lang_entry = malloc(sizeof(*lang_entry));
if (!lang_entry) {
if(!lang_entry) {
lang_entry = malloc(sizeof(*lang_entry));
if (!lang_entry) {
- p
error("malloc() failed"
);
+ p
rintf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__
);
return;
}
lang_entry->ident = strdup(ident);
return;
}
lang_entry->ident = strdup(ident);
@@
-211,7
+212,7
@@
char *build_language_string(struct UserNode *user, char *buffer, const char *msg
if(buffer == NULL) {
buffer = (char *)malloc((MAXLEN+1) * sizeof(char));
if (!buffer) {
if(buffer == NULL) {
buffer = (char *)malloc((MAXLEN+1) * sizeof(char));
if (!buffer) {
- p
error("malloc() failed"
);
+ p
rintf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__
);
return NULL;
}
}
return NULL;
}
}