Skip to content

Commit

Permalink
fmt: use re_fprintf instead of DEBUG_WARNING to avoid deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredh committed Apr 28, 2024
1 parent f3178af commit 6127156
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/fmt/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,12 @@ static int vhprintf(const char *fmt, va_list ap, re_vprintf_h *vph, void *arg,
out:
#ifndef RELEASE
if (err == ENODATA) {
DEBUG_WARNING("Format: \"%b<-- NO ARG\n", fmt, p - fmt + 1);
re_fprintf(stderr, "Format: \"%b<-- NO ARG\n",
fmt, p - fmt + 1);
re_assert(0 && "RE_VA_ARG: no more arguments");
}
if (err == EOVERFLOW) {
DEBUG_WARNING("Format: \"%b<-- SIZE ERROR\n", fmt,
re_fprintf(stderr, "Format: \"%b<-- SIZE ERROR\n", fmt,
p - fmt + 1);
re_assert(0 && "RE_VA_ARG: arg is not compatible");
}
Expand Down

0 comments on commit 6127156

Please sign in to comment.