diff main.c @ 11:fd2e275436a4

Display error messages and free errors
author Guido Berhoerster <guido+xwrited@berhoerster.name>
date Mon, 16 Mar 2015 19:58:21 +0100
parents 0907cc7064d4
children 6440ba6e3466
line wrap: on
line diff
--- a/main.c	Fri Jan 09 17:15:34 2015 +0100
+++ b/main.c	Mon Mar 16 19:58:21 2015 +0100
@@ -146,11 +146,17 @@
 	regex = g_regex_new("([\r\a]+|[ \t\r\a]+$)", G_REGEX_MULTILINE, 0,
 	    &error);
 	if (error != NULL) {
+		g_critical("failed to create regex object: %s",
+		    error->message);
+		g_error_free(error);
 		goto out;
 	}
 	body = g_regex_replace_literal(regex, utf8_str->str, -1, 0, "", 0,
 	    &error);
 	if (error != NULL) {
+		g_critical("failed to replace control and space characters: "
+		    "%s", error->message);
+		g_error_free(error);
 		goto out;
 	}