]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Avoid (null) in printf
authorTakashi Iwai <tiwai@suse.de>
Wed, 9 Jan 2008 16:17:58 +0000 (17:17 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 9 Jan 2008 16:17:58 +0000 (17:17 +0100)
Show '[builtin]' when the library name is NULL in error messages.

src/pcm/pcm.c
src/pcm/pcm_hooks.c

index 100cafd16f4e0dfc2e685d6da31637e62a31ec1c..2ab4e75e7947c07a65570525731f55ce277583d1 100644 (file)
@@ -2100,10 +2100,12 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name,
                open_func = snd_dlsym(h, open_name, SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION));
        err = 0;
        if (!h) {
-               SNDERR("Cannot open shared library %s", lib);
+               SNDERR("Cannot open shared library %s",
+                      lib ? lib : "[builtin]");
                err = -ENOENT;
        } else if (!open_func) {
-               SNDERR("symbol %s is not defined inside %s", open_name, lib);
+               SNDERR("symbol %s is not defined inside %s", open_name,
+                      lib ? lib : "[builtin]");
                snd_dlclose(h);
                err = -ENXIO;
        }
index edfed72a51975f13c0ec4a6721a3af889b5df8b7..0b456aba87da77581fa141f7b3a862ad938f976e 100644 (file)
@@ -388,10 +388,12 @@ static int snd_pcm_hook_add_conf(snd_pcm_t *pcm, snd_config_t *root, snd_config_
        install_func = h ? snd_dlsym(h, install, SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION)) : NULL;
        err = 0;
        if (!h) {
-               SNDERR("Cannot open shared library %s", lib);
+               SNDERR("Cannot open shared library %s",
+                      lib ? lib : "[builtin]");
                err = -ENOENT;
        } else if (!install_func) {
-               SNDERR("symbol %s is not defined inside %s", install, lib);
+               SNDERR("symbol %s is not defined inside %s", install,
+                      lib ? lib : "[builtin]");
                snd_dlclose(h);
                err = -ENXIO;
        }