]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/id3/id3.factor
math.bits: adding binary-bits
[factor.git] / extra / id3 / id3.factor
index 09f10795abc184a1e1183265b96add071f1e6be9..6de42598670549d0cd7e96eec812181bc7cefbbb 100644 (file)
@@ -1,5 +1,5 @@
 ! Copyright (C) 2009 Tim Wawrzynczak, Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
+! See https://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs byte-arrays
 combinators combinators.short-circuit combinators.smart
 continuations io.directories io.encodings.ascii
@@ -116,7 +116,7 @@ CONSTANT: id3v1+-length 227
     [ 10 over size>> 10 + ] dip <slice> filter-text-data ;
 
 : decode-text ( string -- string' )
-    dup 2 cramp head
+    dup 2 index-or-length head
     { { 0xff 0xfe } { 0xfe 0xff } } member?
     utf16 ascii ? decode ;