On Wednesday 09 November 2011 22:39:44 Alexandre Ratchov wrote:
> > sun, sun: or sun:0 for the device and all three of them will play
> > sound.  I'd expect only sun:0 to work.
>
> I agree, the number is mandatory.
>

Sorry for sending a patch on top of my previous patch but is something like 
this acceptable ? Seems to work after some very brief testing.

In case of "sun" use (len+1) to check for the colon and check if there's 
actual data after the colon:

--- sio.c.new   Wed Nov  9 14:09:44 2011
+++ sio.c       Thu Nov 10 12:42:28 2011
@@ -80,7 +80,7 @@
            sio_is_type(str, len, "aucat"))
                return sio_aucat_open(str + len, mode, nbio);
        if (sio_is_type(str, len, "rsnd") ||
-           sio_is_type(str, len, "sun"))
+           (sio_is_type(str, len+1, "sun:") && str[len+1] != '\0'))
                return sio_sun_open(str + len, mode, nbio);
        DPRINTF("sio_open: %s: unknown device type\n", str);
        return NULL;

Reply via email to