Skip to content

Commit

Permalink
fix size of returned firmware version
Browse files Browse the repository at this point in the history
  • Loading branch information
yconst committed Jan 31, 2024
1 parent 91a7ff3 commit 997d260
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions firmware/src/system/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ void system_reset_calibration(void);

static inline uint8_t system_get_fw_version_string(char *buffer)
{
memcpy(buffer, GIT_VERSION, 4);
return 4;
const uint8_t size = fminf(sizeof(GIT_VERSION), 8);
memcpy(buffer, GIT_VERSION, size);
return size;
}

static inline uint32_t system_get_uid(void)
Expand Down

0 comments on commit 997d260

Please sign in to comment.