From 5c348fd6bdcbc0d21d47954a357c150809dabe0c Mon Sep 17 00:00:00 2001 From: Veselin Georgiev Date: Tue, 18 Nov 2008 22:39:14 +0000 Subject: [PATCH] Using set_warn_function() with NULL crashes if warning were to be emitted. Fixed git-svn-id: https://svn.code.sf.net/p/libcpuid/code/HEAD/libcpuid@18 3b4be424-7ac5-41d7-8526-f4ddcb85d872 --- libcpuid/libcpuid_util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libcpuid/libcpuid_util.c b/libcpuid/libcpuid_util.c index 44dc9a9..dc3e4b2 100644 --- a/libcpuid/libcpuid_util.c +++ b/libcpuid/libcpuid_util.c @@ -48,6 +48,7 @@ libcpuid_warn_fn_t _warn_fun = default_warn; void warnf(const char* format, ...) { + if (!_warn_fun) return; char buff[1024]; va_list va; va_start(va, format);