summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-06-21 22:05:39 +0200
committerStanislaw Halik <sthalik@misaki.pl>2019-06-21 22:14:51 +0200
commitedec06ae5e79e0f37c6984b96a350774c8e34520 (patch)
tree561dda658f3f4de07b96a6d7fabf8a70745cd52c
parent5972037c63ac12e8c9ffed84f842347756b82917 (diff)
tracker/{pt,aruco}: fix snprintf invocation
-rw-r--r--tracker-aruco/ftnoir_tracker_aruco.cpp1
-rw-r--r--tracker-pt/module/point_extractor.cpp3
2 files changed, 1 insertions, 3 deletions
diff --git a/tracker-aruco/ftnoir_tracker_aruco.cpp b/tracker-aruco/ftnoir_tracker_aruco.cpp
index bdb41d44..9bf34c51 100644
--- a/tracker-aruco/ftnoir_tracker_aruco.cpp
+++ b/tracker-aruco/ftnoir_tracker_aruco.cpp
@@ -225,7 +225,6 @@ void aruco_tracker::draw_ar(bool ok)
char buf[9];
::snprintf(buf, sizeof(buf)-1, "Hz: %d", clamp(int(fps), 0, 9999));
- buf[sizeof(buf)-1] = '\0';
cv::putText(frame, buf, cv::Point(10, 32), cv::FONT_HERSHEY_PLAIN, 2, cv::Scalar(0, 255, 0), 1);
}
diff --git a/tracker-pt/module/point_extractor.cpp b/tracker-pt/module/point_extractor.cpp
index 1a75a3e3..7ad9925a 100644
--- a/tracker-pt/module/point_extractor.cpp
+++ b/tracker-pt/module/point_extractor.cpp
@@ -225,8 +225,7 @@ static void draw_blobs(cv::Mat& preview_frame, const blob* blobs, unsigned nblob
cv::LINE_AA, fract_bits);
char buf[16];
- buf[sizeof(buf)-1] = '\0';
- std::snprintf(buf, sizeof(buf) - 1, "%.2fpx", (double)b.radius);
+ std::snprintf(buf, sizeof(buf), "%.2fpx", (double)b.radius);
auto text_color = k >= PointModel::N_POINTS
? cv::Scalar(160, 160, 160)