]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3531] Addressed review comments
authorThomas Markwalder <tmark@isc.org>
Thu, 28 Aug 2025 14:12:10 +0000 (10:12 -0400)
committerThomas Markwalder <tmark@isc.org>
Fri, 29 Aug 2025 12:58:42 +0000 (12:58 +0000)
modified:   src/bin/dhcp4/dhcp4_messages.mes
modified:   src/lib/util/str.cc
modified:   src/lib/util/tests/str_unittests.cc

src/bin/dhcp4/dhcp4_messages.mes
src/lib/util/str.cc
src/lib/util/tests/str_unittests.cc

index de0b4308e1c96a42a22e3f46fe630dad19617061..9fd9cf45f9ee87bf2e96c479a2055c7802738130 100644 (file)
@@ -907,7 +907,7 @@ Logged at debug log level 55.
 A debug message printing the details of the received packet. The first
 argument includes the client and the transaction identification
 information. Packet fields ciaddr, yiaddr, siaddr, giaddr, sname, and file
-will be included not empty.
+will be included when not empty.
 
 % DHCP4_QUERY_LABEL received query: %1
 This information message indicates that a query was received. It displays
@@ -1015,7 +1015,7 @@ to the client. The first argument contains the client and the transaction
 identification information. The second and third argument contains the
 packet name and type respectively. The fourth argument contains detailed
 packet information. Packet fields ciaddr, yiaddr, siaddr, giaddr, sname,
-and file will be included not empty.
+and file will be included when not empty.
 
 % DHCP4_RESPONSE_FQDN_DATA %1: including FQDN option in the server's response: %2
 Logged at debug log level 55.
index 843c135fb3840eac3a58cd2a294761d20ec2f495..4198aa4a1ff3b0673abda4ef45f4dbd2a7989c67 100644 (file)
@@ -351,13 +351,11 @@ std::string
 printOrDump(const std::vector<uint8_t>& data, size_t max_dump) {
     auto it = data.begin();
     bool print_it = true;
-    while (it != data.end() && *it != 0) {
+    for ( ; it != data.end() && *it != 0; ++it) {
         if (!isprint(*it)) {
             print_it = false;
             break;
         }
-
-        ++it;
     }
 
     if (print_it && it != data.begin()) {
@@ -367,7 +365,7 @@ printOrDump(const std::vector<uint8_t>& data, size_t max_dump) {
     bool zeros = std::all_of(data.begin(), data.end(), [](int i) { return i==0; });
     if (!zeros) {
         if (data.size() > max_dump) {
-           return (std::string(dumpAsHex(&data[0], max_dump) + std::string("..")));
+           return (dumpAsHex(&data[0], max_dump) + std::string(".."));
         }
 
         return (dumpAsHex(&data[0], data.size()));
index e1a87bb8f9dcb278703339d3f9792ff012449979..9e35086403bdfb220e760f1f5402f05ef3b3183b 100644 (file)
@@ -527,7 +527,7 @@ TEST_F(StringUtilTest, vectorIsPrintable) {
     EXPECT_FALSE(isPrintable(content));
 }
 
-// Verifies the printOrDUmp operates correctly.
+// Verifies the printOrDump operates correctly.
 TEST_F(StringUtilTest, printOrDump) {
     struct Scenario {
         size_t line_;