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

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

version 1.4, 2001/07/12 05:17:10 version 1.5, 2001/11/02 19:41:06
Line 43 
Line 43 
 #include <stdlib.h>  #include <stdlib.h>
 #include <limits.h>  #include <limits.h>
 #include <unistd.h>  #include <unistd.h>
   #include <err.h>
 #include "hexdump.h"  #include "hexdump.h"
   
 off_t skip;                             /* bytes to skip */  off_t skip;                             /* bytes to skip */
Line 81 
Line 82 
                         addfile(optarg);                          addfile(optarg);
                         break;                          break;
                 case 'n':                  case 'n':
                         if ((length = atoi(optarg)) < 0) {                          if ((length = atoi(optarg)) < 0)
                                 (void)fprintf(stderr,                                  errx(1, "bad length value");
                                     "hexdump: bad length value.\n");  
                                 exit(1);  
                         }  
                         break;                          break;
                 case 'o':                  case 'o':
                         add("\"%07.7_Ax\n\"");                          add("\"%07.7_Ax\n\"");
                         add("\"%07.7_ax \" 8/2 \" %06o \" \"\\n\"");                          add("\"%07.7_ax \" 8/2 \" %06o \" \"\\n\"");
                         break;                          break;
                 case 's':                  case 's':
                         if ((skip = strtol(optarg, &p, 0)) < 0) {                          if ((skip = strtol(optarg, &p, 0)) < 0)
                                 (void)fprintf(stderr,                                  errx(1, "bad skip value");
                                     "hexdump: bad skip value.\n");  
                                 exit(1);  
                         }  
                         switch(*p) {                          switch(*p) {
                         case 'b':                          case 'b':
                                 skip *= 512;                                  skip *= 512;
Line 132 
Line 127 
 void  void
 usage()  usage()
 {  {
         (void)fprintf(stderr,          extern char *__progname;
 "hexdump: [-bcdovx] [-e fmt] [-f fmt_file] [-n length] [-s skip] [file ...]\n");          fprintf(stderr, "usage: %s [-bcdovx] [-e fmt] [-f fmt_file] "
                           "[-n length] [-s skip] [file ...]", __progname);
         exit(1);          exit(1);
 }  }

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