Skip to content

Commit

Permalink
Fix directive output truncated writing 4 bytes into a region of size 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
aganm committed Nov 6, 2023
1 parent ee75da1 commit f779596
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ubench.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ UBENCH_EXTERN struct ubench_state_s ubench_state;
static void ubench_##SET##_##NAME(struct ubench_run_state_s *ubs); \
UBENCH_INITIALIZER(ubench_register_##SET##_##NAME) { \
const size_t index = ubench_state.benchmarks_length++; \
const char *name_part = #SET "." #NAME; \
const char name_part[] = #SET "." #NAME; \
const size_t name_size = strlen(name_part) + 1; \
char *name = UBENCH_PTR_CAST(char *, malloc(name_size)); \
ubench_state.benchmarks = UBENCH_PTR_CAST( \
Expand Down Expand Up @@ -432,7 +432,7 @@ UBENCH_EXTERN struct ubench_state_s ubench_state;
} \
UBENCH_INITIALIZER(ubench_register_##FIXTURE##_##NAME) { \
const size_t index = ubench_state.benchmarks_length++; \
const char *name_part = #FIXTURE "." #NAME; \
const char name_part[] = #FIXTURE "." #NAME; \
const size_t name_size = strlen(name_part) + 1; \
char *name = UBENCH_PTR_CAST(char *, malloc(name_size)); \
ubench_state.benchmarks = UBENCH_PTR_CAST( \
Expand Down

0 comments on commit f779596

Please sign in to comment.