[Ecls-list] minor bug fixed in (string-trim)

Ralph Campbell ralphcampbell at sbcglobal.net
Wed Jan 10 07:08:16 UTC 2007


If you eval '(string-trim '(#\space) "")), the function string_trim0()
can index past the end of the array.
        
--- src/c/string.d.old  2007-01-04 21:25:16.000000000 -0800
+++ src/c/string.d      2007-01-05 20:38:55.000000000 -0800
@@ -802,6 +802,8 @@
        cl_index i, j, k;
 
        strng = cl_string(strng);
+       if (strng->base_string.fillp == 0)
+               @(return strng)
        i = 0;
        j = strng->base_string.fillp - 1;
        if (left_trim)





More information about the ecl-devel mailing list