projects/xwrited

changeset 11:fd2e275436a4

Display error messages and free errors
author Guido Berhoerster <guido+xwrited@berhoerster.name>
date Mon Mar 16 19:58:21 2015 +0100 (2015-03-16)
parents 1ec432967d62
children 6440ba6e3466
files main.c
line diff
     1.1 --- a/main.c	Fri Jan 09 17:15:34 2015 +0100
     1.2 +++ b/main.c	Mon Mar 16 19:58:21 2015 +0100
     1.3 @@ -146,11 +146,17 @@
     1.4  	regex = g_regex_new("([\r\a]+|[ \t\r\a]+$)", G_REGEX_MULTILINE, 0,
     1.5  	    &error);
     1.6  	if (error != NULL) {
     1.7 +		g_critical("failed to create regex object: %s",
     1.8 +		    error->message);
     1.9 +		g_error_free(error);
    1.10  		goto out;
    1.11  	}
    1.12  	body = g_regex_replace_literal(regex, utf8_str->str, -1, 0, "", 0,
    1.13  	    &error);
    1.14  	if (error != NULL) {
    1.15 +		g_critical("failed to replace control and space characters: "
    1.16 +		    "%s", error->message);
    1.17 +		g_error_free(error);
    1.18  		goto out;
    1.19  	}
    1.20