LOGCHUNK
char buf[LOGCHUNK];
if (n > LOGCHUNK)
n = LOGCHUNK;
n = cmd->logcount - (lbsize - LOGCHUNK);