On Sun, Jul 17, 2011 at 11:20:28AM +0200, Alexander Schrijver wrote:

> This fixes an integer overflow with very long lines.
> 
> OK?

Hmm, changing from a signed to an unsigned type might lead to
surprises. I think regoff_t is better. 

        -Otto

> 
> Index: util.c
> ===================================================================
> RCS file: /home/alex/scm/cvsync/src/usr.bin/grep/util.c,v
> retrieving revision 1.41
> diff -u -r1.41 util.c
> --- util.c    11 Jul 2011 20:43:21 -0000      1.41
> +++ util.c    17 Jul 2011 09:17:22 -0000
> @@ -169,7 +169,7 @@
>  {
>       regmatch_t      pmatch;
>       int             c, i, r;
> -     int             offset;
> +     size_t          offset;
>  
>       c = 0;
>       i = 0;
> @@ -444,7 +444,7 @@
>  #ifdef SMALL
>       return 0;
>  #else
> -     int j;
> +     size_t j;
>       int rtrnVal = REG_NOMATCH;
>  
>       pmatch->rm_so = -1;

Reply via email to