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

Diff for /src/usr.bin/hexdump/conv.c between version 1.3 and 1.4

version 1.3, 2001/07/12 05:17:10 version 1.4, 2001/12/30 08:17:32
Line 1 
Line 1 
 /*      $OpenBSD$       */  /*      $OpenBSD$       */
   /*      $NetBSD: conv.c,v 1.7 2001/12/07 15:14:29 bjh21 Exp $   */
   
 /*  /*
  * Copyright (c) 1989 The Regents of the University of California.   * Copyright (c) 1989, 1993
  * All rights reserved.   *      The Regents of the University of California.  All rights reserved.
  *   *
  * Redistribution and use in source and binary forms, with or without   * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions   * modification, are permitted provided that the following conditions
Line 39 
Line 40 
 #endif /* not lint */  #endif /* not lint */
   
 #include <sys/types.h>  #include <sys/types.h>
 #include <ctype.h>  
 #include <stdio.h>  #include <stdio.h>
   #include <ctype.h>
   
 #include "hexdump.h"  #include "hexdump.h"
   
 void  void
Line 48 
Line 51 
         PR *pr;          PR *pr;
         u_char *p;          u_char *p;
 {  {
         extern int deprecated;          char buf[10];
         char buf[10], *str;          char const *str;
   
         switch(*p) {          switch(*p) {
         case '\0':          case '\0':
Line 88 
Line 91 
                 *pr->cchar = 'c';                  *pr->cchar = 'c';
                 (void)printf(pr->fmt, *p);                  (void)printf(pr->fmt, *p);
         } else {          } else {
                 (void)sprintf(str = buf, "%03o", (int)*p);                  (void)sprintf(buf, "%03o", (int)*p);
                   str = buf;
 strpr:          *pr->cchar = 's';  strpr:          *pr->cchar = 's';
                 (void)printf(pr->fmt, str);                  (void)printf(pr->fmt, str);
         }          }
Line 99 
Line 103 
         PR *pr;          PR *pr;
         u_char *p;          u_char *p;
 {  {
         extern int deprecated;          static const char *list[] = {
         static char *list[] = {  
                 "nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel",                  "nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel",
                  "bs",  "ht",  "lf",  "vt",  "ff",  "cr",  "so",  "si",                   "bs",  "ht",  "lf",  "vt",  "ff",  "cr",  "so",  "si",
                 "dle", "dcl", "dc2", "dc3", "dc4", "nak", "syn", "etb",                  "dle", "dcl", "dc2", "dc3", "dc4", "nak", "syn", "etb",
Line 117 
Line 120 
         } else if (*p == 0x7f) {          } else if (*p == 0x7f) {
                 *pr->cchar = 's';                  *pr->cchar = 's';
                 (void)printf(pr->fmt, "del");                  (void)printf(pr->fmt, "del");
         } else if (deprecated && *p == 0x20) {  /* od replace space with sp */          } else if (deprecated && *p == 0x20) {  /* od replaced space with sp */
                 *pr->cchar = 's';                  *pr->cchar = 's';
                 (void)printf(pr->fmt, " sp");                  (void)printf(pr->fmt, " sp");
         } else if (isprint(*p)) {          } else if (isprint(*p)) {

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