MCPcopy Create free account
hub / github.com/F-Stack/f-stack / xo_snprintf

Function xo_snprintf

tools/libxo/libxo/xo_syslog.c:431–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429}
430
431static ssize_t
432xo_snprintf (char *out, ssize_t outsize, const char *fmt, ...)
433{
434 ssize_t status;
435 ssize_t retval = 0;
436 va_list ap;
437
438 if (out && outsize) {
439 va_start(ap, fmt);
440 status = vsnprintf(out, outsize, fmt, ap);
441 if (status < 0) { /* this should never happen, */
442 *out = 0; /* handle it in the safest way possible if it does */
443 retval = 0;
444 } else {
445 retval = status;
446 retval = retval > outsize ? outsize : retval;
447 }
448 va_end(ap);
449 }
450
451 return retval;
452}
453
454static xo_ssize_t
455xo_syslog_handle_write (void *opaque, const char *data)

Callers 1

xo_vsyslogFunction · 0.85

Calls 1

vsnprintfFunction · 0.85

Tested by

no test coverage detected