ALSA: rme9652: fix format overflow warnings
authorArnd Bergmann <arnd@arndb.de>
Tue, 18 Jul 2017 11:48:09 +0000 (13:48 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 18 Jul 2017 15:54:41 +0000 (17:54 +0200)
commit7ad210ace5c1701421a4defa9d9e830a6f2ee56b
tree705ef49c6336ed95591902878f4695622980cbc2
parentc6e486ffb2e5a3a3e8f34fb24a6f6f2683cf010b
ALSA: rme9652: fix format overflow warnings

gcc-7 warns about a possible sprintf format string overflow with a
temporary buffer that is used to print from another buffer of the same
size:

sound/pci/rme9652/hdspm.c: In function 'snd_hdspm_create_alsa_devices':
sound/pci/rme9652/hdspm.c:2123:17: error: ' MIDIoverMADI' directive writing 13 bytes into a region of size between 1 and 32 [-Werror=format-overflow=]

This extends the temporary buffer to twice the size, and changes
the code to use the safer snprintf() across the entire file.
The longer buffer is still necessary to avoid a format-truncation
warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/rme9652/hdspm.c