From: Michal Sekletar Date: Wed, 28 Aug 2024 14:01:26 +0000 (+0200) Subject: Reset string explicitely to prevent undefined behavior X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=plocate Reset string explicitely to prevent undefined behavior --- diff --git a/plocate.cpp b/plocate.cpp index 234b703..36f087e 100644 --- a/plocate.cpp +++ b/plocate.cpp @@ -799,6 +799,7 @@ void parse_dbpaths(const char *ptr, vector *output) if (*ptr == ':') { // Separator. output->push_back(move(str)); + str.clear(); ++ptr; continue; }