summaryrefslogtreecommitdiff
path: root/toxcore/logger.c
diff options
context:
space:
mode:
authorMaxim Biro <nurupo.contributions@gmail.com>2015-01-12 02:06:36 -0500
committerMaxim Biro <nurupo.contributions@gmail.com>2015-01-12 02:06:36 -0500
commit045ebf11b8eef9507aaa17a39bc9779256814f93 (patch)
treec5f8c58c3f950946619df59040ed6b2acbc344d6 /toxcore/logger.c
parentdfc6be901cae5133286cbb16e6b651ff26bf2311 (diff)
Fixed Windows build
Apparently ERROR was defined as some constant somewhere on Windows.
Diffstat (limited to 'toxcore/logger.c')
-rw-r--r--toxcore/logger.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/toxcore/logger.c b/toxcore/logger.c
index 2ef5f21a..2c6cf345 100644
--- a/toxcore/logger.c
+++ b/toxcore/logger.c
@@ -109,16 +109,16 @@ logger *logger_new (const char *file_name, LOG_LEVEL level, const char *id)
109 if (!(retu->tstr = calloc(16, sizeof (char))) || 109 if (!(retu->tstr = calloc(16, sizeof (char))) ||
110 !(retu->posstr = calloc(300, sizeof (char))) || 110 !(retu->posstr = calloc(300, sizeof (char))) ||
111 !(retu->msg = calloc(4096, sizeof (char))) ) 111 !(retu->msg = calloc(4096, sizeof (char))) )
112 goto ERROR; 112 goto FAILURE;
113 113
114 if (id) { 114 if (id) {
115 if (!(retu->id = calloc(strlen(id) + 1, 1))) 115 if (!(retu->id = calloc(strlen(id) + 1, 1)))
116 goto ERROR; 116 goto FAILURE;
117 117
118 strcpy(retu->id, id); 118 strcpy(retu->id, id);
119 } else { 119 } else {
120 if (!(retu->id = malloc(8))) 120 if (!(retu->id = malloc(8)))
121 goto ERROR; 121 goto FAILURE;
122 122
123 snprintf(retu->id, 8, "%u", random_int()); 123 snprintf(retu->id, 8, "%u", random_int());
124 } 124 }
@@ -131,7 +131,7 @@ logger *logger_new (const char *file_name, LOG_LEVEL level, const char *id)
131 131
132 return retu; 132 return retu;
133 133
134ERROR: 134FAILURE:
135 fprintf(stderr, "Failed to create logger!\n"); 135 fprintf(stderr, "Failed to create logger!\n");
136 pthread_mutex_destroy(retu->mutex); 136 pthread_mutex_destroy(retu->mutex);
137 fclose(retu->log_file); 137 fclose(retu->log_file);