1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2024-12-26 16:55:45 +00:00

Fix SEGFAULT in debugf() when using --quiet

The `--quiet` option calls `cpuid_set_warn_function(NULL)`, but debugf() was not checking if _warn_fun is defined unlike warnf()
This commit is contained in:
The Tumultuous Unicorn Of Darkness 2024-08-04 14:59:52 +02:00
parent afbc2e5a4a
commit 8f6b84d86c
No known key found for this signature in database
GPG key ID: 1E55EE2EFF18BC1A

View file

@ -73,7 +73,7 @@ void debugf(int verboselevel, const char* format, ...)
{
char buff[1024];
va_list va;
if (verboselevel > _current_verboselevel) return;
if (!_warn_fun || (verboselevel > _current_verboselevel)) return;
va_start(va, format);
vsnprintf(buff, sizeof(buff), format, va);
va_end(va);