j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: mcayland Date: Fri Jun 28 23:08:22 2013 New Revision: 1166 URL: http://tracker.coreboot.org/trac/openbios/changeset/1166
Log: property.fs: fix off-by-one error in decode-string
The sequence 's" test" encode-string decode-string' suffered from an off-by-one error whereby the trailing '\0' would still be left at the end of the decoded string.
This fixes the extra "space" appearing at the end of property names, e.g. such as in the output of "show-devs".
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Modified: trunk/openbios-devel/forth/device/property.fs
Modified: trunk/openbios-devel/forth/device/property.fs ============================================================================== --- trunk/openbios-devel/forth/device/property.fs Fri Jun 28 23:08:08 2013 (r1165) +++ trunk/openbios-devel/forth/device/property.fs Fri Jun 28 23:08:22 2013 (r1166) @@ -185,7 +185,7 @@ >r >r >r ( R: prop-addr1 prop-addr2 prop-len2 nlen ) drop r> r> r> ( nlen prop-len2 prop-addr2 ) - -rot swap ( prop-addr2 prop-len2 nlen ) + -rot swap 1- ( prop-addr2 prop-len2 nlen ) r> swap ( prop-addr2 prop-len2 str len ) else 0 0