diff --git a/include/json_html_serializer.hpp b/include/json_html_serializer.hpp
index f23150e..8d5ed3c 100644
--- a/include/json_html_serializer.hpp
+++ b/include/json_html_serializer.hpp
@@ -233,8 +233,6 @@
                 // continue processing the string
                 state = utf8Accept;
                 break;
-
-                break;
             }
 
             default: // decode found yet incomplete multi-byte code point
@@ -324,7 +322,7 @@
     }
 
     // use a pointer to fill the buffer
-    auto bufferPtr = numberbuffer.begin();
+    auto* bufferPtr = numberbuffer.begin();
 
     const bool isNegative = std::is_same<NumberType, int64_t>::value &&
                             !(number >= 0); // see issue #755
@@ -420,7 +418,7 @@
         return;
     }
 
-    auto end = numberbuffer.begin();
+    auto* end = numberbuffer.begin();
     std::advance(end, len);
     end = std::remove(numberbuffer.begin(), end, ',');
     std::fill(end, numberbuffer.end(), '\0');
@@ -434,7 +432,7 @@
     out.append(numberbuffer.data(), static_cast<std::size_t>(len));
 
     // determine if need to append ".0"
-    auto newEnd = numberbuffer.begin();
+    auto* newEnd = numberbuffer.begin();
     std::advance(newEnd, len + 1);
 
     const bool valueIsIntLike =
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index aeb1d19..c52c99b 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -265,8 +265,8 @@
         tsStr.remove_suffix(tsStr.size() - underscorePos);
         std::string_view indexStr(entryID);
         indexStr.remove_prefix(underscorePos + 1);
-        auto [ptr, ec] = std::from_chars(
-            indexStr.data(), indexStr.data() + indexStr.size(), index);
+        auto [ptr, ec] = std::from_chars(indexStr.begin(), indexStr.end(),
+                                         index);
         if (ec != std::errc())
         {
             messages::resourceNotFound(asyncResp->res, "LogEntry", entryID);
@@ -274,8 +274,7 @@
         }
     }
     // Timestamp has no index
-    auto [ptr, ec] = std::from_chars(tsStr.data(), tsStr.data() + tsStr.size(),
-                                     timestamp);
+    auto [ptr, ec] = std::from_chars(tsStr.begin(), tsStr.end(), timestamp);
     if (ec != std::errc())
     {
         messages::resourceNotFound(asyncResp->res, "LogEntry", entryID);
@@ -2241,10 +2240,8 @@
 
         uint64_t idInt = 0;
 
-        // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
-        const char* end = targetID.data() + targetID.size();
-
-        auto [ptr, ec] = std::from_chars(targetID.data(), end, idInt);
+        auto [ptr, ec] = std::from_chars(&*targetID.begin(), &*targetID.end(),
+                                         idInt);
         if (ec == std::errc::invalid_argument ||
             ec == std::errc::result_out_of_range)
         {
@@ -3668,24 +3665,21 @@
         return false;
     }
 
-    // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
-    const char* start = split[0].data() + 1;
-    // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
-    const char* end = split[0].data() + split[0].size();
-    auto [ptrIndex, ecIndex] = std::from_chars(start, end, index);
+    auto start = std::next(split[0].begin());
+    auto end = split[0].end();
+    auto [ptrIndex, ecIndex] = std::from_chars(&*start, &*end, index);
 
-    if (ptrIndex != end || ecIndex != std::errc())
+    if (ptrIndex != &*end || ecIndex != std::errc())
     {
         return false;
     }
 
-    start = split[1].data();
+    start = split[1].begin();
+    end = split[1].end();
 
-    // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
-    end = split[1].data() + split[1].size();
-    auto [ptrValue, ecValue] = std::from_chars(start, end, currentValue);
+    auto [ptrValue, ecValue] = std::from_chars(&*start, &*end, currentValue);
 
-    return ptrValue == end && ecValue == std::errc();
+    return ptrValue == &*end && ecValue == std::errc();
 }
 
 static bool fillPostCodeEntry(
