refactor: strncpy -> strlcpy

This commit is contained in:
2025-11-10 14:13:27 +01:00
parent f5bf71f535
commit 352f97c2db
7 changed files with 22 additions and 17 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
#include <bsd/string.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/videodev2.h>
@@ -66,7 +67,7 @@ static void ioctl_error(VideoCapture *video_capture, const char *operation,
}
static void open_device(VideoCapture *video_capture, char *name) {
strncpy(video_capture->name, name, STR_LEN);
strlcpy(video_capture->name, name, STR_LEN);
video_capture->error = false;
video_capture->fd = -1;
video_capture->exp_fd = -1;