circular_buffer icon indicating copy to clipboard operation
circular_buffer copied to clipboard

Avoid UB in debug code

Open Flamefire opened this issue 5 months ago • 0 comments

std::memset calls with a nullptr argument are flagged as UB by GCC -fsanitize=undefined, so check the size first

See https://godbolt.org/z/Kjch8dd1d for a simple example showing the diagnostics

Fixes #39

Flamefire avatar Sep 17 '24 17:09 Flamefire