[BACK]Return to midicat.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / midicat

Diff for /src/usr.bin/midicat/midicat.c between version 1.4 and 1.5

version 1.4, 2022/11/30 14:56:45 version 1.5, 2022/12/02 22:21:35
Line 22 
Line 22 
 #include <unistd.h>  #include <unistd.h>
 #include <string.h>  #include <string.h>
   
 char usagestr[] = "usage: midicat [-d] [-i in-file] [-o out-file] "  void __dead usage(void);
         "[-q in-port] [-q out-port]\n";  
   
 int  int
 main(int argc, char **argv)  main(int argc, char **argv)
Line 62 
Line 61 
                         ofile = optarg;                          ofile = optarg;
                         break;                          break;
                 default:                  default:
                         goto bad_usage;                          usage();
                 }                  }
         }          }
         argc -= optind;          argc -= optind;
         argv += optind;          argv += optind;
         if (argc != 0) {  
         bad_usage:  
                 fputs(usagestr, stderr);  
                 return 1;  
         }  
   
           if (argc != 0)
                   usage();
   
         /* we don't support more than one data flow */          /* we don't support more than one data flow */
         if (ifile != NULL && ofile != NULL) {          if (ifile != NULL && ofile != NULL) {
                 fputs("-i and -o are exclusive\n", stderr);                  fputs("-i and -o are exclusive\n", stderr);
Line 87 
Line 84 
   
         /* if there're neither files nor ports, then we've nothing to do */          /* if there're neither files nor ports, then we've nothing to do */
         if (port0 == NULL && ifile == NULL && ofile == NULL)          if (port0 == NULL && ifile == NULL && ofile == NULL)
                 goto bad_usage;                  usage();
   
         /* if no port specified, use default one */          /* if no port specified, use default one */
         if (port0 == NULL)          if (port0 == NULL)
Line 194 
Line 191 
         if (ofile)          if (ofile)
                 close(ofd);                  close(ofd);
         return 0;          return 0;
   }
   
   void __dead
   usage(void)
   {
           fprintf(stderr, "usage: midicat [-d] [-i in-file] [-o out-file] "
               "[-q in-port] [-q out-port]\n");
           exit(1);
 }  }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5