Rockbox Development > Starting Development and Compiling

[SOLVED] logfdump buggy ?

(1/1)

pamaury:
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: ---memcpy(ptr, logfbuffer[tindex], MAX_LOGF_ENTRY);
ptr += MAX_LOGF_ENTRY;

--- End code ---

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: ---memcpy(ptr, logfbuffer[tindex], MAX_LOGF_ENTRY-1);
ptr += MAX_LOGF_ENTRY-1;

--- End code ---
Then the output of logfdump is correct.

Am I correct ?

funman:
In case someone wants to know, yes it was correct, and pamaury : thanks for the patches you wrote and which were committed!

Navigation

[0] Message Index

Go to full version