diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2017-04-10 00:33:58 -0800 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-04-10 00:33:58 -0800 |
commit | e394bd4ba3934cea237ad699cae9fe86396d6f15 (patch) | |
tree | 862fac6474547432f2957057ad178103296a6df4 | |
parent | e783d814e83b2309930e1f6459212da6da8c8a54 (diff) |
silence a compiler warning
-rw-r--r-- | tools-util.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools-util.h b/tools-util.h index 8451b117..732c5108 100644 --- a/tools-util.h +++ b/tools-util.h @@ -26,7 +26,9 @@ do { \ #define mprintf(...) \ ({ \ char *_str; \ - asprintf(&_str, __VA_ARGS__); \ + int ret = asprintf(&_str, __VA_ARGS__); \ + if (ret < 0) \ + die("insufficient memory"); \ _str; \ }) |