aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kbdc/raw-data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mds-kbdc/raw-data.c')
-rw-r--r--src/mds-kbdc/raw-data.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mds-kbdc/raw-data.c b/src/mds-kbdc/raw-data.c
index 359abe8..83e8b48 100644
--- a/src/mds-kbdc/raw-data.c
+++ b/src/mds-kbdc/raw-data.c
@@ -456,14 +456,15 @@ static char* encode_utf8(char* buffer, char32_t character)
text[0] = character;
text[1] = -1;
- if (str_ = str = string_encode(text), str == NULL)
- return NULL;
+ fail_if (str_ = str = string_encode(text), str == NULL);
while (*str)
*buffer++ = *str++;
free(str_);
return buffer;
+ fail:
+ return NULL;
}
@@ -489,8 +490,7 @@ char* parse_raw_string(const char* restrict string)
* is not code point whose UTF-8 encoding is longer than its
* hexadecimal representation. */
p = rc = malloc(strlen(string) * sizeof(char));
- if (rc == NULL)
- return NULL;
+ fail_if (rc == NULL);
while ((c = *string++))
if (r(escape == 8, '0', '7')) buf = (buf << 3) | (c & 15);