Skip to content

Commit

Permalink
Fix build warning about str size computation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 committed Oct 13, 2023
1 parent 190a5b2 commit 6fb9f44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/AArch64/AArch64InstPrinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1305,8 +1305,9 @@ DEFINE_printMatrix(0);
\
const char *RegName = getRegisterName(MCOperand_getReg(RegOp), AArch64_NoRegAltName); \
\
char *Base = malloc(strlen(RegName) + 1); \
strncpy(Base, RegName, strlen(RegName) + 1); \
unsigned buf_len = strlen(RegName) + 1; \
char *Base = calloc(1, buf_len); \
memcpy(Base, RegName, buf_len); \
char *Dot = strchr(Base, '.'); \
if (!Dot) { \
SStream_concat0(O, RegName); \
Expand Down

0 comments on commit 6fb9f44

Please sign in to comment.