1
linux/drivers/net/wireless/ath/ath9k
Dan Carpenter 2b87f3aac0 ath9k/debug: improve the snprintf() handling
The snprintf() function returns the number of bytes that *would* have
been written (not counting the NULL terminator) and that can potentally
be more than the size of the buffer.

In this patch if there were one liners where string clearly fits into
the buffer, then I changed snprintf to sprintf().  It's confusing to use
the return value of snprintf() as a limitter without verifying that it's
smaller than size.  This is what initially caught my attention here.
If we use the return value of sprintf() instead future code auditors will
assume we've verified that it fits already.

Also I did find some places where it made sense to use the return value
after we've verified that it is smaller than the buffer size.

Finally the read_file_rcstat() function added an explicit NULL terminator
before calling snprintf().  That's unnecessary because snprintf() will
add the null terminator automatically.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-02 16:13:07 -04:00
..
ahb.c
ani.c
ani.h
ar5008_initvals.h
ar5008_phy.c
ar9001_initvals.h
ar9002_calib.c
ar9002_hw.c
ar9002_initvals.h
ar9002_mac.c
ar9002_phy.c
ar9002_phy.h
ar9003_2p0_initvals.h ath9k_hw: rename the ar9003_initvals.h to ar9003_2p0_initvals.h 2010-06-02 16:02:54 -04:00
ar9003_2p2_initvals.h ath9k_hw: add support for the AR9003 2.2 2010-06-02 16:02:54 -04:00
ar9003_calib.c drivers/net: Remove unnecessary returns from void function()s 2010-05-14 00:19:28 -07:00
ar9003_eeprom.c ath9k_hw: clean up EEPROM endian handling on AR9003 2010-05-12 16:39:07 -04:00
ar9003_eeprom.h ath9k_hw: clean up EEPROM endian handling on AR9003 2010-05-12 16:39:07 -04:00
ar9003_hw.c ath9k_hw: rename the ar9003_initvals.h to ar9003_2p0_initvals.h 2010-06-02 16:02:54 -04:00
ar9003_mac.c ath9k_hw: add support for the AR9003 baseband watchdog 2010-06-02 16:13:00 -04:00
ar9003_mac.h ath9k_hw: add support for the AR9003 baseband watchdog 2010-06-02 16:13:00 -04:00
ar9003_phy.c ath9k_hw: add support for the AR9003 baseband watchdog 2010-06-02 16:13:00 -04:00
ar9003_phy.h ath9k_hw: add support for the AR9003 baseband watchdog 2010-06-02 16:13:00 -04:00
ath9k.h
beacon.c ath9k: remove VEOL support for ad-hoc 2010-05-25 11:12:54 -04:00
btcoex.c
btcoex.h
calib.c drivers/net: Remove unnecessary returns from void function()s 2010-05-14 00:19:28 -07:00
calib.h
common.c
common.h
debug.c ath9k/debug: improve the snprintf() handling 2010-06-02 16:13:07 -04:00
debug.h ath9k: enable the baseband watchdog events for AR9003 2010-06-02 16:13:00 -04:00
eeprom_4k.c
eeprom_9287.c
eeprom_def.c drivers/net: Remove unnecessary returns from void function()s 2010-05-14 00:19:28 -07:00
eeprom.c drivers/net: Remove unnecessary returns from void function()s 2010-05-14 00:19:28 -07:00
eeprom.h
gpio.c
hif_usb.c ath9k_htc: rare leak in ath9k_hif_usb_alloc_tx_urbs() 2010-05-24 15:07:42 -04:00
hif_usb.h
htc_drv_beacon.c
htc_drv_init.c ath9k_htc: Initialize beacon/CAB queues 2010-06-02 16:13:03 -04:00
htc_drv_main.c ath9k_htc: Add queue statistics to xmit debugfs file 2010-06-02 16:13:02 -04:00
htc_drv_txrx.c ath9k_htc: Remove HW queue translation 2010-06-02 16:13:03 -04:00
htc_hst.c ath9k_htc: Increase credit size 2010-06-02 16:13:04 -04:00
htc_hst.h ath9k_htc: Fix array overflow 2010-05-12 16:39:06 -04:00
htc.h ath9k_htc: Initialize beacon/CAB queues 2010-06-02 16:13:03 -04:00
hw-ops.h
hw.c ath9k: Enable Short GI in 20 Mhz for ar9287 and later chips 2010-06-02 16:13:01 -04:00
hw.h ath9k: Enable Short GI in 20 Mhz for ar9287 and later chips 2010-06-02 16:13:01 -04:00
init.c ath9k: Enable Short GI in 20 Mhz for ar9287 and later chips 2010-06-02 16:13:01 -04:00
Kconfig
mac.c
mac.h
main.c ath9k: enable the baseband watchdog events for AR9003 2010-06-02 16:13:00 -04:00
Makefile
pci.c ath9k: remove AR9003 from PCI IDs for now 2010-05-21 14:40:00 -04:00
phy.h
rc.c ath9k: Enable Short GI in 20 Mhz for ar9287 and later chips 2010-06-02 16:13:01 -04:00
rc.h
recv.c ath9k: fix dma direction for map/unmap in ath_rx_tasklet 2010-06-02 16:13:07 -04:00
reg.h ath9k_hw: add support for the AR9003 baseband watchdog 2010-06-02 16:13:00 -04:00
virtual.c
wmi.c
wmi.h
xmit.c ath9k: Fix bug in the way "bf_tx_aborted" of struct ath_buf is used 2010-05-28 13:40:22 -04:00