git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] banned.h: fix vsprintf()'s ban message

From
Taylor Blau <me@ttaylorr.com>
Date
Aug 25, 2019, 19:42 UTC
Message-ID
<cab687db8315dd4245e1703402a8c76218ee1115.1566762128.git.me@ttaylorr.com>

In cc8fdaee1e (banned.h: mark sprintf() as banned, 2018-07-24), both 'sprintf()' and 'vsprintf()' were marked as banned functions. The non-variadic macro to ban 'vsprintf' has a typo which says that 'sprintf', not 'vsprintf' is banned. The variadic version does not have the same typo.

Fix this by updating the explicit form of 'vsprintf' as the banned version of itself, not 'sprintf'.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
---
 banned.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/banned.h b/banned.h
index 447af24807..60a18d4403 100644
--- a/banned.h
+++ b/banned.h
@@ -26,7 +26,7 @@
 #define vsprintf(...) BANNED(vsprintf)
 #else
 #define sprintf(buf,fmt,arg) BANNED(sprintf)
-#define vsprintf(buf,fmt,arg) BANNED(sprintf)
+#define vsprintf(buf,fmt,arg) BANNED(vsprintf)
 #endif
 
 #endif /* BANNED_H */
-- 
2.22.0
Message 1 of 1 in “banned.h: fix vsprintf()'s ban message”
  1. banned.h: fix vsprintf()'s ban messageTaylor Blau, Aug 25, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.