diff options
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,3 +1,4 @@ | |||
1 | #include "log.h" | ||
1 | #include "util.h" | 2 | #include "util.h" |
2 | #include <string.h> | 3 | #include <string.h> |
3 | #include <tox/tox.h> | 4 | #include <tox/tox.h> |
@@ -134,7 +135,7 @@ void* file_raw(char *path, uint32_t *size) | |||
134 | 135 | ||
135 | file = fopen(path, "rb"); | 136 | file = fopen(path, "rb"); |
136 | if(!file) { | 137 | if(!file) { |
137 | fprintf(stderr, "File not found (%s)\n", path); | 138 | log_printf(L_WARNING, "File not found (%s)\n", path); |
138 | return NULL; | 139 | return NULL; |
139 | } | 140 | } |
140 | 141 | ||
@@ -149,7 +150,7 @@ void* file_raw(char *path, uint32_t *size) | |||
149 | fseek(file, 0, SEEK_SET); | 150 | fseek(file, 0, SEEK_SET); |
150 | 151 | ||
151 | if(fread(data, len, 1, file) != 1) { | 152 | if(fread(data, len, 1, file) != 1) { |
152 | fprintf(stderr, "Read error (%s)\n", path); | 153 | log_printf(L_WARNING, "Read error (%s)\n", path); |
153 | fclose(file); | 154 | fclose(file); |
154 | free(data); | 155 | free(data); |
155 | return NULL; | 156 | return NULL; |
@@ -157,7 +158,7 @@ void* file_raw(char *path, uint32_t *size) | |||
157 | 158 | ||
158 | fclose(file); | 159 | fclose(file); |
159 | 160 | ||
160 | fprintf(stderr, "Read %u bytes (%s)\n", len, path); | 161 | log_printf(L_DEBUG, "Read %u bytes (%s)\n", len, path); |
161 | 162 | ||
162 | if(size) { | 163 | if(size) { |
163 | *size = len; | 164 | *size = len; |