diff --git a/src/modules/Image/encodings/xwd.c b/src/modules/Image/encodings/xwd.c
index d3e2992a1375eafe6309ae72a176e9e8b5ff4f9e..225017561b8d4c19eafd9ea1a9be3817ccbda235 100644
--- a/src/modules/Image/encodings/xwd.c
+++ b/src/modules/Image/encodings/xwd.c
@@ -302,7 +302,7 @@ void img_xwd__decode(INT32 args,int header_only,int skipcmap)
       n++;
       push_text("image");
 
-      if (s->len-(int)(header.header_size+header.ncolors*12)<0)
+      if (s->len-(unsigned int)(header.header_size+header.ncolors*12)<0)
 	 push_empty_string();
       else
 	 push_string(make_shared_binary_string(