Commit Graph

12 Commits

Author SHA1 Message Date
Phillip Stephens b60ad339d5
Fix CStringExtras::CompareCaseInsensitive, `std::lexicographical_compare` does not have the intended behavior 2019-09-28 08:00:49 -07:00
Lioncash 991d048694 CStringExtras: Prevent undefined behavior within IndexOfSubstring
Unlikely to occur, but does completely prevent the case of undefined
behavior if a non-ascii character ends up within the given string.
2019-09-14 16:43:06 -04:00
Lioncash 0d2b2f45a8 CStringExtras: Prevent potential out of bounds reads with CompareCaseInsensitive
The strcasecmp and _stricmp functions expect the passed in strings to
be null-terminated, however we we're also exposing a std::string_view
overload for that function. std::string_view instances aren't required
to be null-terminated, so this makes the interface a little unsafe.

We can use std::lexicographical_compare() to provide the same behavior
and also properly handle the case of non-null-terminated strings.
2019-09-14 16:43:04 -04:00
Jack Andersen 636c82a568 New code style refactor 2018-12-07 19:30:43 -10:00
Jack Andersen c91e5df986 Convert to pragma once 2018-10-06 17:42:33 -10:00
Jack Andersen 8301adc3d6 Huge compile performance refactor 2017-12-28 22:08:12 -10:00
Jack Andersen f7ec7bdc0c string_view refactor 2017-11-12 20:19:18 -10:00
Jack Andersen e2c671e9b4 TCastTo implementation 2017-01-14 17:07:01 -10:00
Jack Andersen 5de5c3d85f Character factory support classes 2016-04-12 20:07:23 -10:00
Jack Andersen 783fb4c4fe Humungous refactor 2016-03-04 13:04:53 -10:00
Phillip Stephens af69c9d3ab Rename namespaces 2016-02-13 01:02:47 -08:00
Jack Andersen f3b5b9f49a various implementation 2015-08-22 20:42:29 -10:00