Skip to content

Commit d6c2884

Browse files
Update simple_string.hpp
1 parent 68a191a commit d6c2884

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/behaviortree_cpp/utils/simple_string.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ class SimpleString {
164164
if (size > 0) {
165165
std::memcpy(_storage.soo.data, input_data, size);
166166
}
167-
_storage.soo.data[size] = '\0';
167+
if(size < CAPACITY) {
168+
_storage.soo.data[size] = '\0';
169+
}
168170
}
169171
}
170172
};

0 commit comments

Comments
 (0)