Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/cddl/osnet/dist/lib/libdtrace/common Fix dodgy argu...
details: https://anonhg.NetBSD.org/src/rev/b71edd6f5093
branches: trunk
changeset: 785078:b71edd6f5093
user: tron <tron%NetBSD.org@localhost>
date: Wed Feb 20 22:45:12 2013 +0000
description:
Fix dodgy arguments to snprintf(3) which cause a warning that breaks
the build (at least with "USE_SSP" set to "yes").
diffstat:
external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diffs (23 lines):
diff -r 37e642428e2e -r b71edd6f5093 external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c
--- a/external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c Wed Feb 20 20:27:42 2013 +0000
+++ b/external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c Wed Feb 20 22:45:12 2013 +0000
@@ -1482,11 +1482,15 @@
if (func == pfprint_stack && (pfd->pfd_flags & DT_PFCONV_LEFT))
width = 0;
- if (width != 0)
- f += snprintf(f, sizeof (format), "%d", ABS(width));
+ if (width != 0) {
+ f += snprintf(f, format + sizeof (format) - f,
+ "%d", ABS(width));
+ }
- if (prec > 0)
- f += snprintf(f, sizeof (format), ".%d", prec);
+ if (prec > 0) {
+ f += snprintf(f, format + sizeof (format) - f,
+ ".%d", prec);
+ }
(void) strcpy(f, pfd->pfd_fmt);
pfd->pfd_rec = rec;
Home |
Main Index |
Thread Index |
Old Index