aboutsummaryrefslogtreecommitdiffstats
path: root/src/error.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-09-18 20:40:31 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-09-18 20:40:31 -0300
commit7e946b6dfb9b29636ac39f269bba6eeee863e24b (patch)
tree551ef093b772f7c36683c4912b05f100fdf0aef9 /src/error.c
parent868702dc1478657d017c9d796236bd4890cd3df1 (diff)
downloadblogc-7e946b6dfb9b29636ac39f269bba6eeee863e24b.tar.gz
blogc-7e946b6dfb9b29636ac39f269bba6eeee863e24b.tar.bz2
blogc-7e946b6dfb9b29636ac39f269bba6eeee863e24b.zip
error: minor memory optimization
Diffstat (limited to 'src/error.c')
-rw-r--r--src/error.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/error.c b/src/error.c
index b4a0138..ad4e3f4 100644
--- a/src/error.c
+++ b/src/error.c
@@ -84,25 +84,19 @@ blogc_error_print(blogc_error_t *err)
if (err == NULL)
return;
- char *tmp = NULL;
-
switch(err->type) {
case BLOGC_ERROR_SOURCE_PARSER:
- tmp = b_strdup("Source parser error");
+ fprintf(stderr, "Source parser error: %s\n", err->msg);
break;
case BLOGC_ERROR_TEMPLATE_PARSER:
- tmp = b_strdup("Template parser error");
+ fprintf(stderr, "Template parser error: %s\n", err->msg);
break;
case BLOGC_ERROR_LOADER:
- tmp = b_strdup("Loader error");
+ fprintf(stderr, "Loader error: %s\n", err->msg);
break;
default:
- tmp = b_strdup("Unknown error");
+ fprintf(stderr, "Unknown error: %s\n", err->msg);
}
-
- fprintf(stderr, "%s: %s\n", tmp, err->msg);
-
- free(tmp);
}