OSDN Git Service

fix infinit loop when array length is 0 or 1.
authorornse01 <ornse01@users.sourceforge.jp>
Sun, 11 Sep 2011 04:52:13 +0000 (04:52 +0000)
committerornse01 <ornse01@users.sourceforge.jp>
Sun, 11 Sep 2011 04:52:13 +0000 (04:52 +0000)
git-svn-id: http://svn.sourceforge.jp/svnroot/bchan/bchanl/trunk@311 20a0b8eb-f62a-4a12-8fe1-b598822500fb

src/subjectlist.c

index dd2e533..a01962b 100644 (file)
@@ -352,6 +352,9 @@ LOCAL VOID sbjtlist_sortedarray_combsort(sbjtlist_sortedarray_t *array, W by)
        sbjtlist_tuple_t *tuple_i, *tuple_i_h;
 
        len = sbjtlist_sortedarray_length(array);
+       if (len <= 1) {
+               return;
+       }
        h = len * 10 / 13;
 
        for (;;) {