summaryrefslogtreecommitdiffstats
path: root/apps/gui/line.h
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2014-01-09 22:59:46 +0100
committerThomas Martitz <kugel@rockbox.org>2014-01-09 23:17:38 +0100
commit7ba2d0160b6b4bfd68fc1d0819858f7138e2d1d4 (patch)
treee1a185272ccaae14cb8c49befdac07e340a2abb9 /apps/gui/line.h
parent3be3a4013829a5d088904803bdd26e339eea61f0 (diff)
downloadrockbox-7ba2d0160b6b4bfd68fc1d0819858f7138e2d1d4.tar.gz
rockbox-7ba2d0160b6b4bfd68fc1d0819858f7138e2d1d4.zip
put_line(): Limit and truncate inline strings to MAX_PATH+32.
Because inline strings have to be copied (to escape '$') the local buffer can be exhaused. The code didn't check for this. The buffer is increased to handle filenames plus some extra chars but truncates to avoid overflow. If you have longer strings please pass them via $t tag, in which case put_line() imposes no additional length-limitation. Change-Id: I0ca20adbe72f6d44cb442f34d665c16b12cbbaeb
Diffstat (limited to 'apps/gui/line.h')
-rw-r--r--apps/gui/line.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/gui/line.h b/apps/gui/line.h
index fa1522003c..9a0769de35 100644
--- a/apps/gui/line.h
+++ b/apps/gui/line.h
@@ -108,9 +108,14 @@ struct line_desc {
* $*t - skips the first n pixels when displaying the string. put_line()
* expects a correspinding paramter of the type 'int' that specifies n.
*
- * Inline text will be printed as is and can be freely intermixed with tags,
- * except when the line can scroll. Due to limitations of the scroll engine
- * only the last piece of text (whether inline or via $t) can scroll.
+ * Inline text will be printed as is (be sure to escape '$') and can be freely
+ * intermixed with tags. Inline text will be truncated after MAX_PATH+31 bytes.
+ * If you have a longer inline string use a separate buffer and pass that via $t,
+ * which does not suffer from this truncation.
+ *
+ * Text can appear anywhere, before or after (or both) tags. However, when the
+ * line can scroll, only the last piece of text (whether inline or via $t) can
+ * scroll. This is due to a scroll_engine limitation.
*
* x, y - pixel postion of the line.
* line - holds information for the line decorations