Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci/bktr - sprintf() -> snprintf()
details: https://anonhg.NetBSD.org/src/rev/386c875515ec
branches: trunk
changeset: 783133:386c875515ec
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Fri Dec 07 05:56:30 2012 +0000
description:
- sprintf() -> snprintf()
- Fix typo in comment.
diffstat:
sys/dev/pci/bktr/bktr_audio.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diffs (53 lines):
diff -r d789ece8bb31 -r 386c875515ec sys/dev/pci/bktr/bktr_audio.c
--- a/sys/dev/pci/bktr/bktr_audio.c Fri Dec 07 05:45:17 2012 +0000
+++ b/sys/dev/pci/bktr/bktr_audio.c Fri Dec 07 05:56:30 2012 +0000
@@ -1,6 +1,6 @@
/* $SourceForge: bktr_audio.c,v 1.6 2003/03/11 23:11:20 thomasklausner Exp $ */
-/* $NetBSD: bktr_audio.c,v 1.18 2008/01/16 13:08:54 jmcneill Exp $ */
+/* $NetBSD: bktr_audio.c,v 1.19 2012/12/07 05:56:30 msaitoh Exp $ */
/* $FreeBSD: src/sys/dev/bktr/bktr_audio.c,v 1.8 2000/10/31 13:09:56 roger Exp$ */
/*
* This is part of the Driver for Video Capture Cards (Frame grabbers)
@@ -71,7 +71,7 @@
#ifdef __NetBSD__
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bktr_audio.c,v 1.18 2008/01/16 13:08:54 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bktr_audio.c,v 1.19 2012/12/07 05:56:30 msaitoh Exp $");
#include <sys/proc.h>
#include <dev/ic/bt8xx.h> /* NetBSD location of .h files */
@@ -465,8 +465,9 @@
rev1 = msp_dpl_read(bktr, bktr->msp_addr, 0x12, 0x001e);
rev2 = msp_dpl_read(bktr, bktr->msp_addr, 0x12, 0x001f);
- sprintf(bktr->msp_version_string, "34%02d%c-%c%d",
- (rev2>>8)&0xff, (rev1&0xff)+'@', ((rev1>>8)&0xff)+'@', rev2&0x1f);
+ snprintf(bktr->msp_version_string, sizeof bktr->msp_version_string,
+ "34%02d%c-%c%d", (rev2>>8)&0xff, (rev1&0xff)+'@', ((rev1>>8)&0xff)+'@',
+ rev2&0x1f);
}
@@ -475,7 +476,7 @@
* For the MSP3430G, we use fast autodetect mode
* For the MSP3410/3415 there are two schemes for this
* a) Fast autodetection - the chip is put into autodetect mode, and the function
- * returns immediatly. This works in most cases and is the Default Mode.
+ * returns immediately. This works in most cases and is the Default Mode.
* b) Slow mode. The function sets the MSP3410/3415 chip, then waits for feedback from
* the chip and re-programs it if needed.
*/
@@ -613,8 +614,9 @@
rev1 = msp_dpl_read(bktr, bktr->dpl_addr, 0x12, 0x001e);
rev2 = msp_dpl_read(bktr, bktr->dpl_addr, 0x12, 0x001f);
- sprintf(bktr->dpl_version_string, "34%02d%c-%c%d",
- ((rev2>>8)&0xff)-1, (rev1&0xff)+'@', ((rev1>>8)&0xff)+'@', rev2&0x1f);
+ snprintf(bktr->dpl_version_string, sizeof bktr->dpl_version_string,
+ "34%02d%c-%c%d", ((rev2>>8)&0xff)-1, (rev1&0xff)+'@',
+ ((rev1>>8)&0xff)+'@', rev2&0x1f);
}
/* Configure the DPL chip to Auto-detect the audio format */
Home |
Main Index |
Thread Index |
Old Index