log fixing
This commit is contained in:
parent
5328610ff1
commit
ca05385513
@ -45,9 +45,9 @@ int _write (int fd, const void *buf, long int len)
|
|||||||
uint8_t * data = (uint8_t *) buf;
|
uint8_t * data = (uint8_t *) buf;
|
||||||
static uint8_t logbuf[1000] = {0};
|
static uint8_t logbuf[1000] = {0};
|
||||||
static int logbuflen = 0;
|
static int logbuflen = 0;
|
||||||
if (logbuflen + len > 1000) {
|
if (logbuflen + len > sizeof(logbuf)) {
|
||||||
int mlen = logbuflen + len - 1000;
|
int mlen = logbuflen + len - sizeof(logbuf);
|
||||||
memmove(logbuf, &logbuf[mlen], mlen);
|
memmove(logbuf, &logbuf[mlen], sizeof(logbuf) - mlen);
|
||||||
logbuflen -= mlen;
|
logbuflen -= mlen;
|
||||||
}
|
}
|
||||||
memcpy(&logbuf[logbuflen], data, len);
|
memcpy(&logbuf[logbuflen], data, len);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user