Fix a integer overflow issue

Alpha of 0xff resulted in RGB_8TO16(0xff) == 0x10000. This was cast to uint8_t
which resulted in alpha being set to 0.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2009-04-17 19:44:50 +02:00 committed by Julien Danjou
parent 388ef61158
commit b38881b123
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@
#include "structs.h" #include "structs.h"
#include <ctype.h> #include <ctype.h>
#define RGB_8TO16(i) (65536 * ((i) & 0xff) / 255) #define RGB_8TO16(i) (0xffff * ((i) & 0xff) / 0xff)
/** Parse an hexadecimal color string to its component. /** Parse an hexadecimal color string to its component.
* \param colstr The color string. * \param colstr The color string.