From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58160 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq6Uk-0002nl-EL for qemu-devel@nongnu.org; Mon, 30 Aug 2010 11:42:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oq6Uj-0004Vt-Be for qemu-devel@nongnu.org; Mon, 30 Aug 2010 11:42:02 -0400 Received: from mail-qy0-f173.google.com ([209.85.216.173]:42826) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oq6Uj-0004Vm-71 for qemu-devel@nongnu.org; Mon, 30 Aug 2010 11:42:01 -0400 Received: by qyk5 with SMTP id 5so3059584qyk.4 for ; Mon, 30 Aug 2010 08:42:00 -0700 (PDT) Message-ID: <4C7BD12B.70300@codemonkey.ws> Date: Mon, 30 Aug 2010 10:41:31 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1283182547-26116-1-git-send-email-Jes.Sorensen@redhat.com> <1283182547-26116-13-git-send-email-Jes.Sorensen@redhat.com> In-Reply-To: <1283182547-26116-13-git-send-email-Jes.Sorensen@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 12/14] size_t is unsigned, so (foo >= 0) is always true List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jes.Sorensen@redhat.com Cc: kwolf@redhat.com, qemu-devel@nongnu.org On 08/30/2010 10:35 AM, Jes.Sorensen@redhat.com wrote: > From: Jes Sorensen > > Signed-off-by: Jes Sorensen > This is the wrong fix, bytes should be a ssize_t or an int because tight_compress_data can return error. Regards, Anthony Liguori > --- > ui/vnc-enc-tight.c | 8 ++++---- > 1 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c > index c4c9c3b..df975af 100644 > --- a/ui/vnc-enc-tight.c > +++ b/ui/vnc-enc-tight.c > @@ -926,7 +926,7 @@ static int send_full_color_rect(VncState *vs, int x, int y, int w, int h) > tight_conf[vs->tight.compression].raw_zlib_level, > Z_DEFAULT_STRATEGY); > > - return (bytes>= 0); > + return 1; > } > > static int send_solid_rect(VncState *vs) > @@ -1001,7 +1001,7 @@ static int send_mono_rect(VncState *vs, int x, int y, > vs->tight.tight.offset = bytes; > > bytes = tight_compress_data(vs, stream, bytes, level, Z_DEFAULT_STRATEGY); > - return (bytes>= 0); > + return 1; > } > > struct palette_cb_priv { > @@ -1057,7 +1057,7 @@ static bool send_gradient_rect(VncState *vs, int x, int y, int w, int h) > > bytes = tight_compress_data(vs, stream, bytes, > level, Z_FILTERED); > - return (bytes>= 0); > + return 1; > } > > static int send_palette_rect(VncState *vs, int x, int y, > @@ -1118,7 +1118,7 @@ static int send_palette_rect(VncState *vs, int x, int y, > > bytes = tight_compress_data(vs, stream, bytes, > level, Z_DEFAULT_STRATEGY); > - return (bytes>= 0); > + return 1; > } > > #if defined(CONFIG_VNC_JPEG) || defined(CONFIG_VNC_PNG) >