Fix off-by-one

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19626 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Maurus Cuelenaere 2008-12-31 17:14:24 +00:00
parent 4c793febc8
commit b6eaf1db1b

View file

@ -145,12 +145,12 @@ void _logf(const char *format, ...)
while(len > MAX_LOGF_ENTRY)
{
ptr = logfbuffer[logfindex];
strncpy(ptr, buf + tlen, MAX_LOGF_ENTRY);
strncpy(ptr, buf + tlen, MAX_LOGF_ENTRY-1);
ptr[MAX_LOGF_ENTRY] = LOGF_TERMINATE_CONTINUE_LINE;
logfindex++;
check_logfindex();
len -= MAX_LOGF_ENTRY;
tlen += MAX_LOGF_ENTRY;
len -= MAX_LOGF_ENTRY-1;
tlen += MAX_LOGF_ENTRY-1;
multiline = true;
}
ptr = logfbuffer[logfindex];