ref: a51bfc11169adc42c383754dfbd88c9cf455341b
parent: 23329f713a934f3dbae5c6cfb1c807489fe3c265
author: cancel <cancel@cancel.fm>
date: Fri Jan 3 19:09:53 EST 2020
Change to use fwrite for cboard pipe write Also fixes wrong newline ending check
--- a/cboard.c
+++ b/cboard.c
@@ -11,10 +11,8 @@
return Cboard_error_popen_failed;
for (Usz iy = 0; iy < rect_h; iy++) {
Glyph const* row = gbuffer + (rect_y + iy) * field_width + rect_x;
- for (Usz ix = 0; ix < rect_w; ix++) {
- fputc(row[ix], fp);
- }
- if (iy < rect_h + 1)
+ fwrite(row, sizeof(Glyph), rect_w, fp);
+ if (iy + 1 < rect_h)
fputc('\n', fp);
}
int status = pclose(fp);