threads / patch / 51733

patchbanned.h: fix vsprintf()'s ban message

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

## tl;dr

One message between Aug 25, 2019 and Aug 25, 2019. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Taylor Blau· Aug 25, 2019, 19:42 UTC · lore

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(-)
Show changes to banned.h +1 −1
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

← back to recent threads