a65c993
To: vim-dev@vim.org
a65c993
Subject: Patch 7.1.167
a65c993
Fcc: outbox
a65c993
From: Bram Moolenaar <Bram@moolenaar.net>
a65c993
Mime-Version: 1.0
a65c993
Content-Type: text/plain; charset=ISO-8859-1
a65c993
Content-Transfer-Encoding: 8bit
a65c993
------------
a65c993
a65c993
Patch 7.1.167
a65c993
Problem:    Xxd crashes when using "xxd -b -c 110". (Debian bug 452789)
a65c993
Solution:   Allocate more memory.  Fix check for maximum number of columns.
a65c993
Files:	    src/xxd/xxd.c
a65c993
a65c993
a65c993
*** ../vim-7.1.166/src/xxd/xxd.c	Thu May 10 19:07:42 2007
a65c993
--- src/xxd/xxd.c	Thu Nov 29 21:05:16 2007
a65c993
***************
a65c993
*** 212,218 ****
a65c993
  
a65c993
  #define TRY_SEEK	/* attempt to use lseek, or skip forward by reading */
a65c993
  #define COLS 256	/* change here, if you ever need more columns */
a65c993
! #define LLEN (9 + (5*COLS-1)/2 + 2 + COLS)
a65c993
  
a65c993
  char hexxa[] = "0123456789abcdef0123456789ABCDEF", *hexx = hexxa;
a65c993
  
a65c993
--- 212,218 ----
a65c993
  
a65c993
  #define TRY_SEEK	/* attempt to use lseek, or skip forward by reading */
a65c993
  #define COLS 256	/* change here, if you ever need more columns */
a65c993
! #define LLEN (11 + (9*COLS-1)/1 + COLS + 2)
a65c993
  
a65c993
  char hexxa[] = "0123456789abcdef0123456789ABCDEF", *hexx = hexxa;
a65c993
  
a65c993
***************
a65c993
*** 590,596 ****
a65c993
        default:			octspergrp = 0; break;
a65c993
        }
a65c993
  
a65c993
!   if (cols < 1 || (!hextype && (cols > COLS)))
a65c993
      {
a65c993
        fprintf(stderr, "%s: invalid number of columns (max. %d).\n", pname, COLS);
a65c993
        exit(1);
a65c993
--- 590,597 ----
a65c993
        default:			octspergrp = 0; break;
a65c993
        }
a65c993
  
a65c993
!   if (cols < 1 || ((hextype == HEX_NORMAL || hextype == HEX_BITS)
a65c993
! 							    && (cols > COLS)))
a65c993
      {
a65c993
        fprintf(stderr, "%s: invalid number of columns (max. %d).\n", pname, COLS);
a65c993
        exit(1);
a65c993
***************
a65c993
*** 750,755 ****
a65c993
--- 751,757 ----
a65c993
  	}
a65c993
        if (ebcdic)
a65c993
  	e = (e < 64) ? '.' : etoa64[e-64];
a65c993
+       /* When changing this update definition of LLEN above. */
a65c993
        l[11 + (grplen * cols - 1)/octspergrp + p] =
a65c993
  #ifdef __MVS__
a65c993
  	  (e >= 64)
a65c993
*** ../vim-7.1.166/src/version.c	Sat Dec  1 21:12:23 2007
a65c993
--- src/version.c	Mon Dec  3 21:30:31 2007
a65c993
***************
a65c993
*** 668,669 ****
a65c993
--- 668,671 ----
a65c993
  {   /* Add new patch number below this line */
a65c993
+ /**/
a65c993
+     167,
a65c993
  /**/
a65c993
a65c993
-- 
a65c993
hundred-and-one symptoms of being an internet addict:
a65c993
178. You look for an icon to double-click to open your bedroom window.
a65c993
a65c993
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
a65c993
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
a65c993
\\\        download, build and distribute -- http://www.A-A-P.org        ///
a65c993
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///