Passing NULL to printf-family of functions is undefined
behaviour. OpenBSD has detection mechanism for occurrences
of such condition. On my machine I get following messages
in syslog, while printing:
vfprintf %s NULL in "DEBUG: OUTFORMAT="%s", so output format will be %s "
Changes in this diff make those messages go away.
goto out;
}
fprintf(stderr, "DEBUG: OUTFORMAT=\"%s\", so output format will be %s\n",
- outformat_env,
+ (outformat_env ? outformat_env : "<none>"),
(outformat == OUTPUT_FORMAT_RASTER ? "CUPS/PWG Raster" :
(outformat == OUTPUT_FORMAT_PDF ? "PDF" :
"PCL XL")));
outformat = OUTPUT_FORMAT_PDF;
#endif
fprintf(stderr, "DEBUG: OUTFORMAT=\"%s\", output format will be %s\n",
- outformat_env, (outformat == OUTPUT_FORMAT_PDF ? "PDF" : "PCLM"));
+ (outformat_env ? outformat_env : "<none>"),
+ (outformat == OUTPUT_FORMAT_PDF ? "PDF" : "PCLM"));
num_options = cupsParseOptions(argv[5], 0, &options);