Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset f2d2c7ba in mainline for kernel/generic/src/lib/string.c


Ignore:
Timestamp:
2009-04-21T16:36:52Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
253d3d0
Parents:
c2417bc
Message:

fix of-by-one-character bug in str_chr() and str_rchr()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/lib/string.c

    rc2417bc rf2d2c7ba  
    642642        wchar_t acc;
    643643        size_t off = 0;
     644        size_t last = 0;
    644645       
    645646        while ((acc = str_decode(str, &off, STR_NO_LIMIT)) != 0) {
    646647                if (acc == ch)
    647                         return (str + off);
     648                        return (str + last);
     649                last = off;
    648650        }
    649651       
Note: See TracChangeset for help on using the changeset viewer.