X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frmr%2Fcommon%2Fsrc%2Fwrapper.c;h=9d3dd72cc1a8b70864a026e684ed1ded8c9e6e73;hb=9c2f0c74adb03a21646742702813b6ba4a4ae288;hp=55cfe9e15b1f191f29592b7a83b834d4bbe42b7f;hpb=3d7285ec4c96724b64968f46c2075b77e8d08543;p=ric-plt%2Flib%2Frmr.git diff --git a/src/rmr/common/src/wrapper.c b/src/rmr/common/src/wrapper.c index 55cfe9e..9d3dd72 100644 --- a/src/rmr/common/src/wrapper.c +++ b/src/rmr/common/src/wrapper.c @@ -32,7 +32,7 @@ #include "../include/rmr.h" -#define ADD_SEP 1 +#define ADD_SEP 1 #define NO_SEP 0 /* @@ -74,7 +74,7 @@ static int bang_on( char* target, char* src, int max ) { if( src && target ) { len = strlen( src ); if( (rc = len <= max ? len : 0 ) > 0 ) { // if it fits, add it. - strcat( target, src ); + strncat( target, src, len ); } } @@ -155,6 +155,6 @@ extern char* rmr_get_consts( ) { phrase = build_ival( "RMR_ERR_INITFAILED", RMR_ERR_INITFAILED, NO_SEP ); remain -= bang_on( wbuf, phrase, remain ); - strcat( wbuf, " }" ); + strncat( wbuf, " }", remain ); return strdup( wbuf ); // chop unused space and return }