Sfoglia il codice sorgente

fixed mpd connection with empty mpdpass introduced by #148

Andrew Karpow 6 anni fa
parent
commit
88b2aa70c8
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      src/ympd.c

+ 2 - 1
src/ympd.c

@@ -113,7 +113,8 @@ int main(int argc, char **argv)
                 run_as_user = strdup(optarg);
                 run_as_user = strdup(optarg);
                 break;
                 break;
             case 'm':
             case 'm':
-                mpd.password = strdup(optarg);
+                if (strlen(optarg) > 0)
+                    mpd.password = strdup(optarg);
                 break;
                 break;
             case 'v':
             case 'v':
                 fprintf(stdout, "ympd  %d.%d.%d\n"
                 fprintf(stdout, "ympd  %d.%d.%d\n"