Skip to content

Commit 76edf39

Browse files
committed
fixed sequrity warning
1 parent 6317fad commit 76edf39

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

hand_eye_calibration/src/app/frontend.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ bool topicHasType(const std::vector<std::string> &types,
8383
}
8484

8585
QString baseImageTopic(const QString &topic) {
86-
constexpr const char *suffix = "/compressed";
87-
return topic.endsWith(suffix) ? topic.left(topic.size() - std::strlen(suffix))
88-
: topic;
86+
constexpr auto suffix = "/compressed";
87+
constexpr qsizetype suffix_len = sizeof("/compressed") - 1;
88+
89+
return topic.endsWith(suffix) ? topic.left(topic.size() - suffix_len) : topic;
8990
}
9091

9192
void appendLog(Ui::HandEyeFrontend &ui, const QString &message) {

0 commit comments

Comments
 (0)