lib/socket: fix `NativeSocket::write_byte`
authorAlexis Laferrière <alexis.laf@xymus.net>
Sun, 24 May 2015 17:26:46 +0000 (13:26 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Mon, 25 May 2015 15:57:27 +0000 (11:57 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/socket/socket_c.nit

index a574485..518fcb5 100644 (file)
@@ -134,7 +134,8 @@ extern class NativeSocket `{ int* `}
 
        # Write `value` as a single byte
        fun write_byte(value: Int): Int `{
-               return write(*recv, &value, 1);
+               unsigned char byt = (unsigned char)value;
+               return write(*recv, &byt, 1);
        `}
 
        fun read: String import NativeString.to_s_with_length `{