summaryrefslogtreecommitdiff
path: root/tools/d2c/format
diff options
context:
space:
mode:
Diffstat (limited to 'tools/d2c/format')
-rw-r--r--tools/d2c/format/tokens.l12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/d2c/format/tokens.l b/tools/d2c/format/tokens.l
index 5db4afa..9bf42af 100644
--- a/tools/d2c/format/tokens.l
+++ b/tools/d2c/format/tokens.l
@@ -23,9 +23,15 @@
. {
char *msg;
- asprintf(&msg, "Unhandled token in d2c format block: '%s'", yytext);
- YY_FATAL_ERROR(msg);
- free(msg);
+ int ret;
+ ret = asprintf(&msg, "Unhandled token in d2c format block: '%s'", yytext);
+ if (ret == -1)
+ YY_FATAL_ERROR("Unhandled token in undisclosed d2c format block");
+ else
+ {
+ YY_FATAL_ERROR(msg);
+ free(msg);
+ }
}