From 73c1399eb4380e0bfdbe4e2e205a6e2cf48f2844 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 11 Oct 2026 20:52:59 +1100 Subject: [PATCH] Remove %w from snprintf compat code. It's not part of the standard, we don't use it and rsync, from whence the code originated, removed it in 2007 along with a bunch of other changes Also fixes a potential out-of bounds read if (%w is used, which we don't). Prompted by github PR#717. --- openbsd-compat/bsd-snprintf.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c index 97892adbd..56160eeca 100644 --- a/openbsd-compat/bsd-snprintf.c +++ b/openbsd-compat/bsd-snprintf.c @@ -468,10 +468,6 @@ dopr(char *buffer, size_t maxlen, const char *format, va_list args_in) case '%': DOPR_OUTCH(buffer, currlen, maxlen, ch); break; - case 'w': - /* not supported yet, treat as next char */ - ch = *format++; - break; default: /* Unknown, skip */ break;