MCPcopy Create free account
hub / github.com/OpenPrinting/cups / doc_printf

Function doc_printf

filter/pstops.c:2010–2032  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2008 */
2009
2010static void
2011doc_printf(pstops_doc_t *doc, /* I - Document information */
2012 const char *format, /* I - Printf-style format string */
2013 ...) /* I - Additional arguments as needed */
2014{
2015 va_list ap; /* Pointer to arguments */
2016 char buffer[1024]; /* Output buffer */
2017 ssize_t bytes; /* Number of bytes to write */
2018
2019
2020 va_start(ap, format);
2021 bytes = vsnprintf(buffer, sizeof(buffer), format, ap);
2022 va_end(ap);
2023
2024 if ((size_t)bytes > sizeof(buffer))
2025 {
2026 _cupsLangPrintFilter(stderr, "ERROR",
2027 _("Buffer overflow detected, aborting."));
2028 exit(1);
2029 }
2030
2031 doc_write(doc, buffer, (size_t)bytes);
2032}
2033
2034
2035/*

Callers 5

copy_commentsFunction · 0.85
do_setupFunction · 0.85
start_nupFunction · 0.85
write_label_prologFunction · 0.85
write_labelsFunction · 0.85

Calls 2

_cupsLangPrintFilterFunction · 0.85
doc_writeFunction · 0.85

Tested by

no test coverage detected