Skip to content

Display and control your Android device

Make message buffer static

Romain Vimont1e4ee547b560
diff --git a/app/src/controller.c b/app/src/controller.c
index b68b886b..c5897e5d 100644
--- a/app/src/controller.c
+++ b/app/src/controller.c
@@ -60,7 +60,7 @@ controller_push_msg(struct controller *controller,
static bool
process_msg(struct controller *controller,
const struct control_msg *msg) {
- unsigned char serialized_msg[CONTROL_MSG_MAX_SIZE];
+ static unsigned char serialized_msg[CONTROL_MSG_MAX_SIZE];
int length = control_msg_serialize(msg, serialized_msg);
if (!length) {
return false;
diff --git a/app/src/receiver.c b/app/src/receiver.c
index bfe9d6e9..5ecff3b7 100644
--- a/app/src/receiver.c
+++ b/app/src/receiver.c
@@ -60,7 +60,7 @@ static int
run_receiver(void *data) {
struct receiver *receiver = data;
- unsigned char buf[DEVICE_MSG_MAX_SIZE];
+ static unsigned char buf[DEVICE_MSG_MAX_SIZE];
size_t head = 0;
for (;;) {