Index: uspace/srv/hid/rfb/rfb.c
===================================================================
--- uspace/srv/hid/rfb/rfb.c	(revision cecba66ea48d60cfa59865e98aeda663808e42c7)
+++ uspace/srv/hid/rfb/rfb.c	(revision 0fb1755f9a1204c8e5bf55872e7b17086340cd84)
@@ -418,8 +418,8 @@
 }
 
-static ssize_t rfb_tile_encode_raw(rfb_t *rfb, cpixel_ctx_t *cpixel,
+static size_t rfb_tile_encode_raw(rfb_t *rfb, cpixel_ctx_t *cpixel,
     rfb_rectangle_t *tile, void *buf)
 {
-	ssize_t size = tile->width * tile->height * cpixel->size;
+	size_t size = tile->width * tile->height * cpixel->size;
 	if (buf == NULL)
 		return size;
@@ -435,6 +435,6 @@
 }
 
-static ssize_t rfb_tile_encode_solid(rfb_t *rfb, cpixel_ctx_t *cpixel,
-    rfb_rectangle_t *tile, void *buf)
+static size_t rfb_tile_encode_solid(rfb_t *rfb, cpixel_ctx_t *cpixel,
+    rfb_rectangle_t *tile, void *buf, size_t *size)
 {
 	/* Check if it is single color */
@@ -443,5 +443,5 @@
 		for (uint16_t x = tile->x; x < tile->x + tile->width; x++) {
 			if (pixelmap_get_pixel(&rfb->framebuffer, x, y) != the_color)
-				return -1;
+				return EINVAL;
 		}
 	}
@@ -450,5 +450,6 @@
 	if (buf)
 		cpixel_encode(rfb, cpixel, buf, the_color);
-	return cpixel->size;
+	*size = cpixel->size;
+	return EOK;
 }
 
@@ -474,6 +475,8 @@
 			
 			uint8_t tile_enctype = RFB_TILE_ENCODING_SOLID;
-			ssize_t tile_size = rfb_tile_encode_solid(rfb, &cpixel, &tile, buf);
-			if (tile_size < 0) {
+			size_t tile_size;
+			int rc = rfb_tile_encode_solid(rfb, &cpixel, &tile, buf,
+			    &tile_size);
+			if (rc != EOK) {
 				tile_size = rfb_tile_encode_raw(rfb, &cpixel, &tile, buf);
 				tile_enctype = RFB_TILE_ENCODING_RAW;
