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 Dec 3, 2023
1 parent 3294239 commit dc1e202
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 @@ -393,7 +393,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 @@ -438,7 +438,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 dc1e202

Please sign in to comment.