comparison 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
comparison
equal deleted inserted replaced
10:1ec432967d62 11:fd2e275436a4
144 144
145 /* remove any CR, BEL and trailing space and tabs */ 145 /* remove any CR, BEL and trailing space and tabs */
146 regex = g_regex_new("([\r\a]+|[ \t\r\a]+$)", G_REGEX_MULTILINE, 0, 146 regex = g_regex_new("([\r\a]+|[ \t\r\a]+$)", G_REGEX_MULTILINE, 0,
147 &error); 147 &error);
148 if (error != NULL) { 148 if (error != NULL) {
149 g_critical("failed to create regex object: %s",
150 error->message);
151 g_error_free(error);
149 goto out; 152 goto out;
150 } 153 }
151 body = g_regex_replace_literal(regex, utf8_str->str, -1, 0, "", 0, 154 body = g_regex_replace_literal(regex, utf8_str->str, -1, 0, "", 0,
152 &error); 155 &error);
153 if (error != NULL) { 156 if (error != NULL) {
157 g_critical("failed to replace control and space characters: "
158 "%s", error->message);
159 g_error_free(error);
154 goto out; 160 goto out;
155 } 161 }
156 162
157 /* 163 /*
158 * skip empty messages or messages only consisting of whitespace and 164 * skip empty messages or messages only consisting of whitespace and