]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Fix bugs in perm option
authorTakashi Iwai <tiwai@suse.de>
Thu, 19 May 2005 15:14:05 +0000 (15:14 +0000)
committerTakashi Iwai <tiwai@suse.de>
Thu, 19 May 2005 15:14:05 +0000 (15:14 +0000)
Fixed silly bugs in perm option.

src/pcm/pcm_file.c

index acd1d2ca8350f27fac8d3b252ba0a7f18c9e30bd..38c6577ae46308554f98e65d78c060704808610d 100644 (file)
@@ -27,6 +27,7 @@
  */
   
 #include <byteswap.h>
+#include <ctype.h>
 #include "pcm_local.h"
 #include "pcm_plugin.h"
 
@@ -539,18 +540,18 @@ int _snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
                        continue;
                }
                if (strcmp(id, "perm") == 0) {
-                       char *perm;
+                       char *str;
                        char *endp;
-                       err = snd_config_get_ascii(n, &perm);
+                       err = snd_config_get_ascii(n, &str);
                        if (err < 0) {
                                SNDERR("The field perm must be a valid file permission");
                                return err;
                        }
-                       if (isdigit(*perm) == 0) {
+                       if (isdigit(*str) == 0) {
                                SNDERR("The field perm must be a valid file permission");
                                return -EINVAL;
                        }
-                       perm = strtol(perm, &endp, 8);
+                       perm = strtol(str, &endp, 8);
                        continue;
                }
                SNDERR("Unknown field %s", id);