aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPen-Yung Yu <penyung.yu@mediatek.com>2015-01-20 16:35:14 +0800
committerPen-Yung Yu <penyung.yu@mediatek.com>2015-01-20 17:15:28 +0800
commit1672c4c1ac83f55f52c0c40bf4be44d8350236ef (patch)
treeb87a619a49ae2dbbf80a771cf984d25c52d18eee
parentb4c0ee570093604fed612bb9cd3d2f9809a87588 (diff)
downloadndk-1672c4c1ac83f55f52c0c40bf4be44d8350236ef.tar.gz
Constrain return value of __lexicographical_compare_3way
Add this constraint to make sure collate::compare can meet spec requirement. Change-Id: I1563fe29734a825353f80d4e9f9a2b4f8424e107
-rw-r--r--sources/cxx-stl/stlport/stlport/stl/_algobase.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/cxx-stl/stlport/stlport/stl/_algobase.h b/sources/cxx-stl/stlport/stlport/stl/_algobase.h
index 597dcbea3..0627e7227 100644
--- a/sources/cxx-stl/stlport/stlport/stl/_algobase.h
+++ b/sources/cxx-stl/stlport/stlport/stl/_algobase.h
@@ -625,7 +625,7 @@ __lexicographical_compare_3way(const unsigned char* __first1,
const ptrdiff_t __len1 = __last1 - __first1;
const ptrdiff_t __len2 = __last2 - __first2;
const int __result = memcmp(__first1, __first2, (min) (__len1, __len2));
- return __result != 0 ? __result
+ return __result != 0 ? (__result > 0 ? 1 : -1 )
: (__len1 == __len2 ? 0 : (__len1 < __len2 ? -1 : 1));
}