From f6c719d7ec71cc7771c46d3daa390924a3871ba3 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Mon, 14 Nov 2022 11:32:34 -0500 Subject: replace strlcpy with strmemccpy replace applicable calls to strlcpy with calls to strmemccpy which null terminates on truncation in theory the strmemccpy calls should be slightly faster since they don't traverse the rest of the source string on truncation but I seriously doubt there is too much of that going on in the code base Change-Id: Ia0251514e36a6242bbf3f03c5e0df123aba60ed2 --- apps/bookmark.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/bookmark.c') diff --git a/apps/bookmark.c b/apps/bookmark.c index d594c51320..0cc2807609 100644 --- a/apps/bookmark.c +++ b/apps/bookmark.c @@ -1075,7 +1075,7 @@ static bool parse_bookmark(const char *bookmark, const bool parse_filenames, con { size_t len = (end == NULL) ? strlen(s) : (size_t) (end - s); len = MIN(TEMP_BUF_SIZE - 1, len); - strlcpy(global_temp_buffer, s, len + 1); + strmemccpy(global_temp_buffer, s, len + 1); if (end != NULL) { @@ -1089,7 +1089,7 @@ static bool parse_bookmark(const char *bookmark, const bool parse_filenames, con end++; } } - strlcpy(global_filename, end, MAX_PATH); + strmemccpy(global_filename, end, MAX_PATH); } } -- cgit v1.2.3