Rename read_length to read_uint16, and add a read_uint8.
[fjl] / input.c
diff --git a/input.c b/input.c
index 2d80457a7202f08f9018ce5fe350e308dd84cae8..6bcfd3a03192ccfe9f96d8120006f291c570435c 100644 (file)
--- a/input.c
+++ b/input.c
@@ -27,7 +27,14 @@ void reliable_read(raw_input_func_t* input_func, void* userdata, uint8_t* buf, s
        }
 }
 
-uint16_t read_length(raw_input_func_t* input_func, void* userdata)
+uint8_t read_uint8(raw_input_func_t* input_func, void* userdata)
+{
+       uint8_t ret;
+       reliable_read(input_func, userdata, &ret, 1);
+       return ret;
+}
+
+uint16_t read_uint16(raw_input_func_t* input_func, void* userdata)
 {
        uint8_t buf[2];
        reliable_read(input_func, userdata, buf, 2);