]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
dynbuf: assert on curlx_dyn_addf use with just "%s"
authorDaniel Stenberg <daniel@haxx.se>
Tue, 5 Aug 2025 22:52:04 +0000 (00:52 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 6 Aug 2025 06:32:07 +0000 (08:32 +0200)
Because it is wasteful and should be done better.

Closes #18194

lib/curlx/dynbuf.c

index cd4f4635a610aaed05bdf805ebb997df8a997b54..447203e42a8afd98c53d47b872fcd4e7a674d3d8 100644 (file)
@@ -231,6 +231,7 @@ CURLcode curlx_dyn_addf(struct dynbuf *s, const char *fmt, ...)
   DEBUGASSERT(s);
   DEBUGASSERT(s->init == DYNINIT);
   DEBUGASSERT(!s->leng || s->bufr);
+  DEBUGASSERT(strcmp(fmt, "%s")); /* use curlx_dyn_add instead */
   va_start(ap, fmt);
   result = curlx_dyn_vaddf(s, fmt, ap);
   va_end(ap);