direct-io.hg

changeset 11477:e87e5d216c0b

[XEN] Fix array ngative accesses in figlet tool.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Sep 15 10:59:18 2006 +0100 (2006-09-15)
parents 65b33e64b642
children 3f57453d404c
files xen/tools/figlet/figlet.c
line diff
     1.1 --- a/xen/tools/figlet/figlet.c	Thu Sep 14 16:01:46 2006 +0100
     1.2 +++ b/xen/tools/figlet/figlet.c	Fri Sep 15 10:59:18 2006 +0100
     1.3 @@ -1448,8 +1448,9 @@ inchr c;
     1.4        }
     1.5      else {
     1.6        for (k=0;k<smushamount;k++) {
     1.7 -        outputline[row][outlinelen-smushamount+k] =
     1.8 -          smushem(outputline[row][outlinelen-smushamount+k],currchar[row][k]);
     1.9 +        if (outlinelen-smushamount+k >= 0)
    1.10 +          outputline[row][outlinelen-smushamount+k] =
    1.11 +            smushem(outputline[row][outlinelen-smushamount+k],currchar[row][k]);
    1.12          }
    1.13        strcat(outputline[row],currchar[row]+smushamount);
    1.14        }