Branch: Tag:

1999-01-24

1999-01-24 23:36:42 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed some argument checking of ghost.

Rev: server/modules/graphics/graphic_text.pike:1.155

1: - constant cvs_version="$Id: graphic_text.pike,v 1.154 1998/12/30 00:12:43 js Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.155 1999/01/24 23:36:42 grubba Exp $";   constant thread_safe=1;      #include <module.h>
543:       if(args->ghost)    { // Francesco.. -  int sdist = (int)args->ghost; -  int bl=(int)(args->ghost/",")[1]; -  array(int)clr=parse_color((args->ghost/",")[-1]); +  array(string) a = (args->ghost/","); +  if (sizeof(a) < 2) { +  // Bad argument. +  } else { +  int sdist = (int)(a[0]); +  int bl=(int)(a[1]); +  array(int)clr=parse_color(a[-1]);    int j;    object ta = text_alpha->copy();    for (j=0;j<bl;j++)
555:    background->paste_alpha_color(ta,@clr,xoffset+sdist,yoffset+sdist);    fgcolor=bgcolor;    } +  }          if(args->shadow)