Changeset 18821


Ignore:
Timestamp:
2009-03-27T12:16:45+13:00 (15 years ago)
Author:
mdewsnip
Message:

Change to findlastchar() so if the same character is passed as first and last_plus_one values it won't run backwards and likely segfault.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/common-src/src/lib/text_t.cpp

    r18700 r18821  
    361361               unsigned short c)
    362362{
    363   text_t::iterator current = last_plus_one - 1;
     363  text_t::iterator current = (last_plus_one != first) ? last_plus_one - 1 : first;
    364364  while (current != first) {
    365365    if (*current == c) break;
Note: See TracChangeset for help on using the changeset viewer.