Index: CLAM/src/Tools/AudioIO/Linux/ALSAAudioDevice.cxx
===================================================================
--- CLAM/src/Tools/AudioIO/Linux/ALSAAudioDevice.cxx	(revision 9977)
+++ CLAM/src/Tools/AudioIO/Linux/ALSAAudioDevice.cxx	(working copy)
@@ -25,7 +25,7 @@
 #include "AudioOut.hxx"
 #include "AudioDeviceList.hxx"
 #include "AudioDevice.hxx"
-#include <cstdio>
+#include <sstream>
 
 namespace CLAM {
 
@@ -278,7 +278,7 @@
 		ALSAAudioDeviceList()
 			:AudioDeviceList(std::string("alsa"))
 		{
-			char name[64];
+			std::stringstream name;
 			int card, dev;
 			snd_ctl_t *handle;
 			snd_ctl_card_info_t *info;
@@ -288,8 +288,8 @@
 			if (snd_card_next(&card) < 0 || card < 0)
 				return; // No cards found
 			while (card >= 0) {
-				std::snprintf(name, 63,"hw:%d", card);
-				if (snd_ctl_open(&handle, name, 0) < 0)
+				name << "hw:" << card;
+				if (snd_ctl_open(&handle, name.str().c_str(), 0) < 0)
 					continue; // Card control open error!
 				if (snd_ctl_card_info(handle, info) < 0) {
 					snd_ctl_close(handle); // Card control read error!
@@ -300,10 +300,12 @@
 					snd_ctl_pcm_next_device(handle, &dev);
 					if (dev < 0)
 						break;
-					std::snprintf(name, 63,"hw:%d,%d", card,dev);
-					mAvailableDevices.push_back(name);
-					std::snprintf(name, 63,"plughw:%d,%d", card,dev);
-					mAvailableDevices.push_back(name);
+					name << "," << dev;
+					mAvailableDevices.push_back(name.str());
+
+					name.clear();
+					name << "plughw:" << card << "," << dev;
+					mAvailableDevices.push_back(name.str());
 				}
 				snd_ctl_close(handle);
 				if (snd_card_next(&card) < 0)
Index: CLAM/src/Tools/MIDIIO/Linux/ALSAMIDIDevice.cxx
===================================================================
--- CLAM/src/Tools/MIDIIO/Linux/ALSAMIDIDevice.cxx	(revision 9977)
+++ CLAM/src/Tools/MIDIIO/Linux/ALSAMIDIDevice.cxx	(working copy)
@@ -23,6 +23,7 @@
 #include <alsa/asoundlib.h>
 #include "MIDIDeviceList.hxx"
 #include "MIDIDevice.hxx"
+#include <sstream>
 
 namespace CLAM {
 
@@ -121,7 +122,7 @@
 		ALSAMIDIDeviceList()
 			:MIDIDeviceList(std::string("alsa"))
 		{
-			char name[64];
+			std::stringstream name;
 			int card, dev;
 			snd_ctl_t *handle;
 			snd_ctl_card_info_t *info;
@@ -131,8 +132,8 @@
 			if (snd_card_next(&card) < 0 || card < 0)
 				return; // No cards found
 			while (card >= 0) {
-				std::snprintf(name, 63,"hw:%d", card);
-				if (snd_ctl_open(&handle, name, 0) < 0)
+				name << "hw:" << card;	
+				if (snd_ctl_open(&handle, name.str().c_str(), 0) < 0)
 					continue; // Card control open error!
 				if (snd_ctl_card_info(handle, info) < 0) {
 					snd_ctl_close(handle); // Card control read error!
@@ -143,8 +144,8 @@
 					snd_ctl_rawmidi_next_device(handle, &dev);
 					if (dev < 0)
 						break;
-					std::snprintf(name, 63,"hw:%d,%d", card,dev);
-					mAvailableDevices.push_back(name);
+					name << "," << dev;
+					mAvailableDevices.push_back(name.str());
 				}
 				snd_ctl_close(handle);
 				if (snd_card_next(&card) < 0)
