From 2ee9cc5e1832c8f79326ec70ba4fe2405c9e86e0 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Tue, 7 Feb 2012 11:15:32 +0100 Subject: [PATCH] Simplify code by using per_read_length() instead of reimplementing it. --- libfreerdp-core/fastpath.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/libfreerdp-core/fastpath.c b/libfreerdp-core/fastpath.c index 22cf16367..b7ac3c685 100644 --- a/libfreerdp-core/fastpath.c +++ b/libfreerdp-core/fastpath.c @@ -53,7 +53,6 @@ uint16 fastpath_read_header(rdpFastPath* fastpath, STREAM* s) { uint8 header; uint16 length; - uint8 t; stream_read_uint8(s, header); @@ -63,15 +62,7 @@ uint16 fastpath_read_header(rdpFastPath* fastpath, STREAM* s) fastpath->numberEvents = (header & 0x3C) >> 2; } - stream_read_uint8(s, length); /* length1 */ - /* If most significant bit is not set, length2 is not presented. */ - if ((length & 0x80)) - { - length &= 0x7F; - length <<= 8; - stream_read_uint8(s, t); - length += t; - } + per_read_length(s, &length); return length; }