Only completeWrite() if we didn't run off the end of the buffer.
If we did run off the end, complain about it.
This commit is contained in:
parent
39d905324f
commit
c712543ee5
6
net_io.c
6
net_io.c
|
@ -1196,7 +1196,11 @@ static void writeFATSV() {
|
|||
}
|
||||
|
||||
p += snprintf(p, bufsize(p,end), "\n");
|
||||
completeWrite(&Modes.fatsv_out, p);
|
||||
|
||||
if (p <= end)
|
||||
completeWrite(&Modes.fatsv_out, p);
|
||||
else
|
||||
fprintf(stderr, "fatsv: output too large (max %d, overran by %d)\n", TSV_MAX_PACKET_SIZE, (int) (p - end));
|
||||
# undef bufsize
|
||||
|
||||
a->fatsv_last_emitted = now;
|
||||
|
|
Loading…
Reference in a new issue