From 7580427837e74393a0bfb87ee1bf733ae59cdf93 Mon Sep 17 00:00:00 2001 From: Randall Fitzgerald Date: Fri, 9 Jun 2023 04:56:31 -0400 Subject: [PATCH] Resolving some review comments --- examples/server/server.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 7e3b5fdf4..46b17ed08 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -16,7 +16,7 @@ struct server_params static size_t common_part(const std::vector& a, const std::vector& b) { size_t i; - for (i = 0; i < a.size() && i < b.size() && a[i] == b[i]; i++); + for (i = 0; i < a.size() && i < b.size() && a[i] == b[i]; i++) {} return i; } @@ -33,7 +33,7 @@ bool ends_with(const std::string& str, const std::string& suffix) size_t find_partial_stop_string(const std::string& stop, const std::string& text) { - if (!text.empty()) { + if (!text.empty() && !stop.empty()) { const char text_last_char = text.back(); for (int64_t char_index = stop.size() - 1; char_index >= 0; char_index--) { if (stop[char_index] == text_last_char) {