Skip to content

Commit

Permalink
log.h: null-terminate compile-time filename strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ohwgiles committed Apr 17, 2019
1 parent 21ea536 commit 448d8cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace _ {
}
template<int N, int...I>
static constexpr decltype(auto) static_alloc_str_impl(const char* str, std::integer_sequence<int, I...>) {
return (struct {char buf[N];}) {str[I]...};
return (struct {char buf[N+1];}) {str[I]..., 0};
}
template<int N>
static constexpr decltype(auto) static_alloc_str(const char* str) {
Expand Down

0 comments on commit 448d8cf

Please sign in to comment.