Skip to content

Display and control your Android device

Simplfy memcpy() parameters

Romain Vimont1e085efcfc30
diff --git a/app/src/server.c b/app/src/server.c
index 2b2123e6..8bff8613 100644
--- a/app/src/server.c
+++ b/app/src/server.c
@@ -601,7 +601,7 @@ device_read_info(struct sc_intr *intr, sc_socket device_socket,
// in case the client sends garbage
buf[SC_DEVICE_NAME_FIELD_LENGTH - 1] = '\0';
static_assert(sizeof(info->device_name) == SC_DEVICE_NAME_FIELD_LENGTH);
- memcpy(info->device_name, (char *) buf, sizeof(info->device_name));
+ memcpy(info->device_name, buf, SC_DEVICE_NAME_FIELD_LENGTH);
return true;
}