- buf[0] = 0x01;
- (void)sprintf(buf + 1, fmt, a1, a2, a3);
- len = strlen(buf);
- (void)write(rem, buf, len);
+ if (!fp && !(fp = fdopen(rem, "w")))
+ return;
+ (void)fprintf(fp, "%c", 0x01);
+ (void)fprintf(fp, fmt, a1, a2, a3);
+ (void)fflush(fp);