Hey yall, I noticed that dprintf()
was missing from the alpha release’s stdio library. Does beta now feature this function?
As a workaround, I am doing:
#include <stdarg.h>
int dprintf(int fd, const char *restrict format, ...) {
va_list ap;
FILE *f = fdopen(fd, "w");
if (!f) {
return -1;
}
va_start(ap, format);
int result = fprintf(f, format, ap);
va_end(ap);
if (fclose(f) == EOF) {
return EOF;
}
return result;
}
This seems to basically work, as basic as it is, so I thought I’d post it.
By the way, the Discuss WYSIWYG is acting strange about preformatted text–the last curly brace should be considered part of the code, but it is ending up as normal text for some reason.