Skip to content

Commit 997d260

Browse files
committed
fix size of returned firmware version
1 parent 91a7ff3 commit 997d260

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

firmware/src/system/system.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ void system_reset_calibration(void);
4141

4242
static inline uint8_t system_get_fw_version_string(char *buffer)
4343
{
44-
memcpy(buffer, GIT_VERSION, 4);
45-
return 4;
44+
const uint8_t size = fminf(sizeof(GIT_VERSION), 8);
45+
memcpy(buffer, GIT_VERSION, size);
46+
return size;
4647
}
4748

4849
static inline uint32_t system_get_uid(void)

0 commit comments

Comments
 (0)