Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Don't play format string tricks, use two calls w...
details: https://anonhg.NetBSD.org/src/rev/4ec72eee32ad
branches: trunk
changeset: 765551:4ec72eee32ad
user: joerg <joerg%NetBSD.org@localhost>
date: Mon May 30 13:55:27 2011 +0000
description:
Don't play format string tricks, use two calls with the correct number
of arguments for each.
diffstat:
sys/dev/usb/umidi.c | 30 ++++++++++++++++--------------
1 files changed, 16 insertions(+), 14 deletions(-)
diffs (54 lines):
diff -r 9e4ee1dde7f5 -r 4ec72eee32ad sys/dev/usb/umidi.c
--- a/sys/dev/usb/umidi.c Mon May 30 13:52:26 2011 +0000
+++ b/sys/dev/usb/umidi.c Mon May 30 13:55:27 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umidi.c,v 1.42 2010/11/03 22:34:24 dyoung Exp $ */
+/* $NetBSD: umidi.c,v 1.43 2011/05/30 13:55:27 joerg Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.42 2010/11/03 22:34:24 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.43 2011/05/30 13:55:27 joerg Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -1291,21 +1291,23 @@
show_ep_in = sc-> sc_in_num_endpoints > 1 && !sc->cblnums_global;
show_ep_out = sc->sc_out_num_endpoints > 1 && !sc->cblnums_global;
- if ( NULL != md->in_jack )
- snprintf(in_label, sizeof in_label,
- show_ep_in ? "<%d(%x) " : "<%d ",
- md->in_jack->cable_number,
- md->in_jack->endpoint->addr);
+ if ( NULL == md->in_jack )
+ in_label[0] = '\0';
+ else if ( show_ep_in )
+ snprintf(in_label, sizeof in_label, "<%d(%x) ",
+ md->in_jack->cable_number, md->in_jack->endpoint->addr);
else
- in_label[0] = '\0';
+ snprintf(in_label, sizeof in_label, "<%d ",
+ md->in_jack->cable_number);
- if ( NULL != md->out_jack )
- snprintf(out_label, sizeof out_label,
- show_ep_out ? ">%d(%x) " : ">%d ",
- md->out_jack->cable_number,
- md->out_jack->endpoint->addr);
+ if ( NULL == md->out_jack )
+ out_label[0] = '\0';
+ else if ( show_ep_out )
+ snprintf(out_label, sizeof out_label, ">%d(%x) ",
+ md->out_jack->cable_number, md->out_jack->endpoint->addr);
else
- out_label[0] = '\0';
+ snprintf(out_label, sizeof out_label, ">%d ",
+ md->out_jack->cable_number);
unit_label = device_xname(sc->sc_dev);
Home |
Main Index |
Thread Index |
Old Index