From: Joel Rosdahl Date: Tue, 24 Mar 2020 20:33:56 +0000 (+0100) Subject: Remove incorrect result check in `format` X-Git-Tag: v3.7.9~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0b1a0d78bfaac9321fc077464002bd42e6f15e5e;p=thirdparty%2Fccache.git Remove incorrect result check in `format` `format` considers a zero-length result (e.g. from `format("%s", "")`) to be a fatal error. The check originates from 0a7cea64 where it was appropriate but become incorrect later when refactoring the original `x_asprintf2` function to `format`. I can’t find any call to `format` that would trigger this edge case, but let’s remove the erroneous check anyway. Related to #568. --- diff --git a/src/util.c b/src/util.c index b6cce75ef..0fd3f0fe3 100644 --- a/src/util.c +++ b/src/util.c @@ -703,9 +703,6 @@ format(const char *format, ...) } va_end(ap); - if (!*ptr) { - fatal("Internal error in format"); - } return ptr; }