use sizeof instead of hardcoded struct size in colour cache

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@435 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Jay Sorg 2003-07-28 18:13:30 +00:00
parent 7ff54cdd90
commit 694bd388a4
2 changed files with 2 additions and 2 deletions

View File

@ -742,7 +742,7 @@ process_colcache(STREAM s)
in_uint8(s, cache_id); in_uint8(s, cache_id);
in_uint16_le(s, map.ncolours); in_uint16_le(s, map.ncolours);
map.colours = (COLOURENTRY *) xmalloc(3 * map.ncolours); map.colours = (COLOURENTRY *) xmalloc(sizeof(COLOURENTRY) * map.ncolours);
for (i = 0; i < map.ncolours; i++) for (i = 0; i < map.ncolours; i++)
{ {

2
rdp.c
View File

@ -765,7 +765,7 @@ process_palette(STREAM s)
in_uint16_le(s, map.ncolours); in_uint16_le(s, map.ncolours);
in_uint8s(s, 2); /* pad */ in_uint8s(s, 2); /* pad */
map.colours = (COLOURENTRY *) xmalloc(3 * map.ncolours); map.colours = (COLOURENTRY *) xmalloc(sizeof(COLOURENTRY) * map.ncolours);
DEBUG(("PALETTE(c=%d)\n", map.ncolours)); DEBUG(("PALETTE(c=%d)\n", map.ncolours));