summaryrefslogtreecommitdiff
path: root/src/config/ConfigWatcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/config/ConfigWatcher.cpp')
-rw-r--r--src/config/ConfigWatcher.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/config/ConfigWatcher.cpp b/src/config/ConfigWatcher.cpp
index 2ec1c05d..f3a8a2ca 100644
--- a/src/config/ConfigWatcher.cpp
+++ b/src/config/ConfigWatcher.cpp
@@ -72,15 +72,15 @@ void CConfigWatcher::onInotifyEvent() {
if (bytesRead <= 0)
return;
- for (size_t offset = 0; offset < (size_t)bytesRead;) {
- const auto* ev = (const inotify_event*)(buffer.data() + offset);
+ for (size_t offset = 0; offset < sc<size_t>(bytesRead);) {
+ const auto* ev = rc<const inotify_event*>(buffer.data() + offset);
- if (offset + sizeof(inotify_event) > (size_t)bytesRead) {
+ if (offset + sizeof(inotify_event) > sc<size_t>(bytesRead)) {
Debug::log(ERR, "CConfigWatcher: malformed inotify event, truncated header");
break;
}
- if (offset + sizeof(inotify_event) + ev->len > (size_t)(bytesRead)) {
+ if (offset + sizeof(inotify_event) + ev->len > sc<size_t>(bytesRead)) {
Debug::log(ERR, "CConfigWatcher: malformed inotify event, truncated name field");
break;
}