diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 1f222f849..fc7a7218e 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -53,6 +53,7 @@ Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository fix access violation when --debug:xxxx has no other args after it Setting the inverse attribute for gold had the space before "$:" getting highlighted along with the gold field +sortloot segfaulted when filtering a subset of items (seen with 'A' command) Platform- and/or Interface-Specific Fixes diff --git a/src/invent.c b/src/invent.c index c2d4861a8..9ea974698 100644 --- a/src/invent.c +++ b/src/invent.c @@ -462,7 +462,7 @@ boolean FDECL((*filterfunc), (OBJ_P)); augment_filter = (mode & SORTLOOT_PETRIFY) ? TRUE : FALSE; mode &= ~SORTLOOT_PETRIFY; /* remove flag, leaving mode */ /* populate aliarray[0..n-1] */ - for (i = 0, o = *olist; o; ++i, o = by_nexthere ? o->nexthere : o->nobj) { + for (i = 0, o = *olist; o; o = by_nexthere ? o->nexthere : o->nobj) { if (filterfunc && !(*filterfunc)(o) /* caller may be asking us to override filterfunc (in order to do a cockatrice corpse touch check during pickup even @@ -473,6 +473,7 @@ boolean FDECL((*filterfunc), (OBJ_P)); sliarray[i].obj = o, sliarray[i].indx = (int) i; sliarray[i].str = (char *) 0; sliarray[i].orderclass = sliarray[i].subclass = sliarray[i].disco = 0; + ++i; } n = i; /* add a terminator so that we don't have to pass 'n' back to caller */