diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-09-18 20:40:31 -0300 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-09-18 20:40:31 -0300 |
commit | 7e946b6dfb9b29636ac39f269bba6eeee863e24b (patch) | |
tree | 551ef093b772f7c36683c4912b05f100fdf0aef9 | |
parent | 868702dc1478657d017c9d796236bd4890cd3df1 (diff) | |
download | blogc-7e946b6dfb9b29636ac39f269bba6eeee863e24b.tar.gz blogc-7e946b6dfb9b29636ac39f269bba6eeee863e24b.tar.bz2 blogc-7e946b6dfb9b29636ac39f269bba6eeee863e24b.zip |
error: minor memory optimization
-rw-r--r-- | src/error.c | 14 |
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); } |