writerune() should operate on a FILE *
This commit is contained in:
@@ -7,16 +7,16 @@
|
||||
#include "../utf.h"
|
||||
|
||||
void
|
||||
writerune(Rune *r)
|
||||
writerune(const char *file, FILE *fp, Rune *r)
|
||||
{
|
||||
char buf[UTFmax];
|
||||
int n;
|
||||
|
||||
if ((n = runetochar(buf, r)) > 0) {
|
||||
fwrite(buf, n, 1, stdout);
|
||||
if (ferror(stdout)) {
|
||||
fprintf(stderr, "stdout: write error: %s\n",
|
||||
strerror(errno));
|
||||
fwrite(buf, n, 1, fp);
|
||||
if (ferror(fp)) {
|
||||
fprintf(stderr, "%s: write error: %s\n",
|
||||
file, strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user