MCPcopy Create free account
hub / github.com/cisco/libsrtp / srtp_err_report

Function srtp_err_report

crypto/kernel/err.c:81–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81void srtp_err_report(srtp_err_reporting_level_t level, const char *format, ...)
82{
83 char msg[512];
84 va_list args;
85 if (srtp_err_file != NULL) {
86 va_start(args, format);
87 vfprintf(srtp_err_file, format, args);
88 va_end(args);
89 }
90 if (srtp_err_report_handler != NULL) {
91 va_start(args, format);
92 if (vsnprintf(msg, sizeof(msg), format, args) > 0) {
93 /* strip trailing \n, callback should not have one */
94 size_t l = strlen(msg);
95 if (l && msg[l - 1] == '\n') {
96 msg[l - 1] = '\0';
97 }
98 srtp_err_report_handler(level, msg);
99 /*
100 * NOTE, need to be carefull, there is a potential that
101 * octet_string_set_to_zero() could
102 * call srtp_err_report() in the future, leading to recursion
103 */
104 octet_string_set_to_zero(msg, sizeof(msg));
105 }
106 va_end(args);
107 }
108}

Callers 3

srtp_event_reporterFunction · 0.85

Calls 1

octet_string_set_to_zeroFunction · 0.85

Tested by

no test coverage detected