summaryrefslogtreecommitdiff
path: root/apps/recorder/pcm_record.c
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-11-14 11:32:34 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2022-11-14 23:56:16 -0500
commitf6c719d7ec71cc7771c46d3daa390924a3871ba3 (patch)
treee6209f23565db01809f75067247e667963092ff6 /apps/recorder/pcm_record.c
parentb25a9d8f99b75570d18ea64602de7fe48da612d6 (diff)
downloadrockbox-f6c719d7ec71cc7771c46d3daa390924a3871ba3.tar.gz
rockbox-f6c719d7ec71cc7771c46d3daa390924a3871ba3.zip
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
Diffstat (limited to 'apps/recorder/pcm_record.c')
-rw-r--r--apps/recorder/pcm_record.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/recorder/pcm_record.c b/apps/recorder/pcm_record.c
index d3d45d3e1c..f7f4c77928 100644
--- a/apps/recorder/pcm_record.c
+++ b/apps/recorder/pcm_record.c
@@ -1352,7 +1352,7 @@ static void mark_stream(const char *path, enum mark_stream_action action)
1352 1352
1353 file->hdr.type = CHUNK_T_STREAM_START; 1353 file->hdr.type = CHUNK_T_STREAM_START;
1354 file->hdr.size = count; 1354 file->hdr.size = count;
1355 strlcpy(file->path, path, MAX_PATH); 1355 strmemccpy(file->path, path, MAX_PATH);
1356 } 1356 }
1357} 1357}
1358 1358
@@ -1582,7 +1582,7 @@ static void on_record(const char *filename)
1582 1582
1583 /* Copy path and let caller go */ 1583 /* Copy path and let caller go */
1584 char path[MAX_PATH]; 1584 char path[MAX_PATH];
1585 strlcpy(path, filename, MAX_PATH); 1585 strmemccpy(path, filename, MAX_PATH);
1586 1586
1587 queue_reply(&audio_queue, 0); 1587 queue_reply(&audio_queue, 0);
1588 1588