From 44250de12042954c8aae8d6c51ba927821a95f85 Mon Sep 17 00:00:00 2001 From: "Malenovsky, Vladimir" Date: Tue, 3 Feb 2026 10:14:21 +0100 Subject: [PATCH] replace sizeof() with strlen() --- apps/decoder.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 73b7e3d269..72008b8287 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1939,9 +1939,13 @@ static ivas_error initOnFirstGoodFrame( if ( arg.rtpOutSR && srRtp != NULL ) { FILE *fParamsSR = NULL; - char srParamsFile[FILENAME_MAX], *ext = ".sr.txt"; - strncpy( srParamsFile, arg.outputWavFilename, FILENAME_MAX - sizeof( ext ) ); - strncat( srParamsFile, ext, sizeof( ext ) + 1 ); + char srParamsFile[FILENAME_MAX]; + const char *ext = ".sr.txt"; + + strncpy( srParamsFile, arg.outputWavFilename, FILENAME_MAX - strlen( ext ) - 1 ); + srParamsFile[FILENAME_MAX - strlen( ext ) - 1] = '\0'; + strncat( srParamsFile, ext, strlen( ext ) ); + srParamsFile[FILENAME_MAX - 1] = '\0'; /* Write the Split Rendering Params passed from SDP to srParamsFile */ fParamsSR = fopen( srParamsFile, "w" ); -- GitLab