- if (pipeout[1]) {
- if (write(pipeout[1], msg, sizeof(msg)) < 0)
- fprintf(stderr, "surf: error sending: %s\n", msg);
+ if ((ret = snprintf(msg, sizeof(msg), "%c%c%c%c",
+ 4, c->pageid, type, a->i))
+ >= sizeof(msg)) {
+ fprintf(stderr, "surf: message too long: %d\n", ret);
+ return;