Fix string copy termination
Test: CTS regression
Bug: 78198288
Change-Id: Id433eb3197d4faf530d5f5090ff95e51689e7088
diff --git a/services/audioflinger/BufLog.cpp b/services/audioflinger/BufLog.cpp
index 2780290..ae96036 100644
--- a/services/audioflinger/BufLog.cpp
+++ b/services/audioflinger/BufLog.cpp
@@ -24,6 +24,7 @@
#include <pthread.h>
#include <stdio.h>
#include <string.h>
+#include <audio_utils/string.h>
#define MIN(a, b) ((a) < (b) ? (a) : (b))
@@ -117,7 +118,7 @@
mByteCount = 0l;
mPaused = false;
if (tag != NULL) {
- strncpy(mTag, tag, BUFLOGSTREAM_MAX_TAGSIZE);
+ (void)audio_utils_strlcpy(mTag, tag);
} else {
mTag[0] = 0;
}