summaryrefslogtreecommitdiffstats
path: root/firmware/logf.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-12-31 17:14:24 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-12-31 17:14:24 +0000
commitb6eaf1db1b87f1b8053c8ea739b236d95960b83d (patch)
tree87c38228606ca2ef7b965a85ee06a145f874b6fc /firmware/logf.c
parent4c793febc8c4c828ab2bb7d7de3c37b05ac0cac2 (diff)
downloadrockbox-b6eaf1db1b87f1b8053c8ea739b236d95960b83d.tar.gz
rockbox-b6eaf1db1b87f1b8053c8ea739b236d95960b83d.tar.bz2
rockbox-b6eaf1db1b87f1b8053c8ea739b236d95960b83d.zip
Fix off-by-one
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19626 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/logf.c')
-rw-r--r--firmware/logf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/logf.c b/firmware/logf.c
index 539c2af9da..4296a7a342 100644
--- a/firmware/logf.c
+++ b/firmware/logf.c
@@ -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];