diff options
author | 2003-07-24 01:15:41 +0000 | |
---|---|---|
committer | 2003-07-24 01:15:41 +0000 | |
commit | a177c125a832d4619888274f7db8a6d315f069e8 (patch) | |
tree | 4812d950c1cea5a5289a7535434984b8112f8fb6 /lib/libc/stdio/vsprintf.c | |
parent | sync (diff) | |
download | wireguard-openbsd-a177c125a832d4619888274f7db8a6d315f069e8.tar.xz wireguard-openbsd-a177c125a832d4619888274f7db8a6d315f069e8.zip |
warn about unsafe APIs at link time. Conditional on libc/Makefile defining
APIWARN; disabled by default. In use by many developers for quite some time,
now they have a common knob to enable/disable this
Diffstat (limited to 'lib/libc/stdio/vsprintf.c')
-rw-r--r-- | lib/libc/stdio/vsprintf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libc/stdio/vsprintf.c b/lib/libc/stdio/vsprintf.c index 97010c5fc6e..e024a2fb880 100644 --- a/lib/libc/stdio/vsprintf.c +++ b/lib/libc/stdio/vsprintf.c @@ -31,12 +31,17 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: vsprintf.c,v 1.7 2003/06/11 21:05:09 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: vsprintf.c,v 1.8 2003/07/24 01:15:42 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> #include <limits.h> +#if defined(APIWARN) +__warn_references(vsprintf, + "warning: vsprintf() is often misused, please use vsnprintf()"); +#endif + int vsprintf(str, fmt, ap) char *str; |