Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  [SOLVED] logfdump buggy ?
« previous next »
  • Print
Pages: [1]

Author Topic: [SOLVED] logfdump buggy ?  (Read 2420 times)

Offline pamaury

  • Developer
  • Member
  • *
  • Posts: 508
[SOLVED] logfdump buggy ?
« on: August 10, 2009, 11:15:46 AM »
Hello,
I think the logfdump function is buggy. More precisely, it fails to correctly display multiline.
When printing a long line on my Sansa e200, it stops after the first MAX_LOGF_ENTRY characters instead of correctly displaying the whole line.

I suspect the bug is due to those lines:
Code: [Select]
memcpy(ptr, logfbuffer[tindex], MAX_LOGF_ENTRY);
ptr += MAX_LOGF_ENTRY;

Indeed, by copying MAX_LOGF_ENTRY characters, it also copy the 0 at the end of each line (added by strlcpy if _logf) so the output stops at the end of first part of the whole line.

I think is must be changed to:
Code: [Select]
memcpy(ptr, logfbuffer[tindex], MAX_LOGF_ENTRY-1);
ptr += MAX_LOGF_ENTRY-1;
Then the output of logfdump is correct.

Am I correct ?
« Last Edit: August 18, 2009, 05:51:41 AM by pamaury »
Logged
Please don't PM me, use our IRC channel instead.

Offline funman

  • Developer
  • Member
  • *
  • Posts: 645
Re: logfdump buggy ?
« Reply #1 on: August 14, 2009, 06:53:52 PM »
In case someone wants to know, yes it was correct, and pamaury : thanks for the patches you wrote and which were committed!
Logged
a wise man said: "a wise man said"

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  [SOLVED] logfdump buggy ?
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.065 seconds with 21 queries.