]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
ue2string: fix broken function type in upperString
authorJustin Viiret <justin.viiret@intel.com>
Fri, 6 May 2016 04:20:38 +0000 (14:20 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 18 May 2016 06:28:00 +0000 (16:28 +1000)
Silences warning from ubsan.

src/util/ue2string.cpp

index 6fdc57ba5314cad5ef31ee5873e685ba60ecf031..7c16aa587b20c48b60374f17c3e919f764ad5186 100644 (file)
@@ -129,7 +129,9 @@ string dumpString(const ue2_literal &lit) {
 #endif
 
 void upperString(string &s) {
-    transform(s.begin(), s.end(), s.begin(), (int(*)(int)) mytoupper);
+    for (auto &c : s) {
+        c = mytoupper(c);
+    }
 }
 
 size_t maxStringOverlap(const string &a, const string &b, bool nocase) {