From 8ba91c12fea7af3548b762670e4184a93be7c444 Mon Sep 17 00:00:00 2001 From: q66 Date: Wed, 5 Aug 2015 21:58:06 +0100 Subject: [PATCH] string clear check --- ostd/string.hh | 1 + 1 file changed, 1 insertion(+) diff --git a/ostd/string.hh b/ostd/string.hh index dbc75d4..8f8a100 100644 --- a/ostd/string.hh +++ b/ostd/string.hh @@ -331,6 +331,7 @@ public: } void clear() { + if (!p_len) return; p_len = 0; *p_buf.first() = '\0'; }