Changeset 18821

Show
Ignore:
Timestamp:
27.03.2009 12:16:45 (10 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.

Files:
1 modified

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;