On Mon, Mar 17, 2008 at 6:49 PM, Hubert Figuiere <hfiguiere@teaser.fr> wrote:
>
>
>  On Mon, 2008-03-17 at 23:47 +0100, cvs@abisource.com wrote:
>  > Log:
>  > KWord import: Sanity check RGB values. Please backport.
>  >
>  >
>  >
>  > Modified: abiword/trunk/plugins/kword/xp/ie_imp_KWord_1.cpp
>  > ===================================================================
>  > --- abiword/trunk/plugins/kword/xp/ie_imp_KWord_1.cpp 2008-03-17 22:39:51 UTC (rev 23162)
>  > +++ abiword/trunk/plugins/kword/xp/ie_imp_KWord_1.cpp 2008-03-17 22:47:16 UTC (rev 23163)
>  > @@ -388,14 +388,20 @@
>  >       p = _getXMLPropValue("red", atts);
>  >       if (p != NULL) {
>  >         red = atoi(p);
>  > +       if (red < 0 || red > 255)
>  > +         red = 0;
>
>  I'd do it that way:
>
>  if (red < 0)
>         red = 0;
>  else if (red > 255)
>         red = 255;
>
>
>  And so on.
>
>  That's more sane IMHO.
Good idea.  Fixed in r23165.
Received on Tue Mar 18 02:50:59 2008
This archive was generated by hypermail 2.1.8 : Tue Mar 18 2008 - 02:50:59 CET