[PATCH] include/string: Bail out early on erase
Rosen Penev
rosenp at gmail.com
Sun Oct 27 05:43:45 UTC 2019
When string is empty.
Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
include/string | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/string b/include/string
index 020c469..abdcc0c 100644
--- a/include/string
+++ b/include/string
@@ -323,6 +323,9 @@ public:
iterator temp = last;
+ if (!count)
+ return first;
+
while(last != vector<Ch, A>::end()){
*(last - count) = *last;
++last;
--
2.23.0
More information about the uClibc
mailing list