Check and fix format string for turn_log_func_default (#1064)

This commit is contained in:
Gregor Jasny 2022-10-31 19:07:04 +01:00 committed by GitHub
parent 15153f5406
commit 83b8ddb744
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 5 deletions

View File

@ -1270,8 +1270,8 @@ unsigned long get_system_number_of_cpus(void)
return sysInfo.dwNumberOfProcessors;
#else
#if defined(_SC_NPROCESSORS_ONLN)
TURN_LOG_FUNC(TURN_LOG_LEVEL_DEBUG, "System cpu num is %d \n", sysconf(_SC_NPROCESSORS_CONF));
TURN_LOG_FUNC(TURN_LOG_LEVEL_DEBUG, "System enable num is %d\n", sysconf(_SC_NPROCESSORS_ONLN));
TURN_LOG_FUNC(TURN_LOG_LEVEL_DEBUG, "System cpu num is %ld \n", sysconf(_SC_NPROCESSORS_CONF));
TURN_LOG_FUNC(TURN_LOG_LEVEL_DEBUG, "System enable num is %ld\n", sysconf(_SC_NPROCESSORS_ONLN));
return sysconf(_SC_NPROCESSORS_CONF);
#else
//GNU way

View File

@ -71,7 +71,11 @@ void set_syslog_facility(char *val);
void set_turn_log_timestamp_format(char* new_format);
void turn_log_func_default(char* file, int line, TURN_LOG_LEVEL level, const char* format, ...);
void turn_log_func_default(char* file, int line, TURN_LOG_LEVEL level, const char* format, ...)
#ifdef __GNUC__
__attribute__ ((format (printf, 4, 5)))
#endif
;
void addr_debug_print(int verbose, const ioa_addr *addr, const char* s);

View File

@ -2839,7 +2839,7 @@ int main(int argc, char **argv)
int cpus = get_system_number_of_cpus();
if (0 < cpus)
turn_params.cpus = get_system_number_of_cpus();
TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO, "System cpu num is %d\n", turn_params.cpus);
TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO, "System cpu num is %lu\n", turn_params.cpus);
if (turn_params.cpus < DEFAULT_CPUS_NUMBER)
turn_params.cpus = DEFAULT_CPUS_NUMBER;
else if (turn_params.cpus > MAX_NUMBER_OF_GENERAL_RELAY_SERVERS)

View File

@ -576,7 +576,7 @@ int main(int argc, char **argv)
{
if (!SSL_CTX_load_verify_locations(root_tls_ctx[sslind], ca_cert_file, NULL )) {
TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR,
"ERROR: cannot load CA from file\n",
"ERROR: cannot load CA from file: %s\n",
ca_cert_file);
exit(-1);
}