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:
parent
7ff54cdd90
commit
694bd388a4
2
orders.c
2
orders.c
@ -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
2
rdp.c
@ -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));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user