Ack Thanks Lennart
> -----Original Message----- > From: Vu Minh Nguyen [mailto:[email protected]] > Sent: den 4 november 2015 08:59 > To: [email protected]; Lennart Lund; Giang Do T > Cc: [email protected] > Subject: [PATCH 1 of 1] log: logtest sometimes gets failed at test case 15 and > 38 of suite 6 [#1584] > > tests/logsv/tet_LogOiOps.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > > There is an uninitialized character in an static array of characters. > When outputting the string, the character at that position is unknown. > > It causes trouble when passing the string to shell if the character is > special > ones. > > Fix them by initializing all elements. > > diff --git a/tests/logsv/tet_LogOiOps.c b/tests/logsv/tet_LogOiOps.c > --- a/tests/logsv/tet_LogOiOps.c > +++ b/tests/logsv/tet_LogOiOps.c > @@ -3333,7 +3333,7 @@ void verFilenameLength_01(void) > char fileName[220]; > > /* Create a string with 218 characters */ > - memset(fileName, 'A', 218); > + memset(fileName, 'A', sizeof(fileName)); > fileName[219] = '\0'; > > /* Create an configurable obj class with invalid filename length > */ > @@ -3352,11 +3352,11 @@ void verFilenameLength_02(void) > char fileName[220]; > > /* Create a string with 218 characters */ > - memset(fileName, 'A', 218); > + memset(fileName, 'A', sizeof(fileName)); > fileName[219] = '\0'; > > /* Create an configurable obj class with invalid filename length > */ > - sprintf(command, "immcfg -a saLogStreamFileName=. -a > saLogStreamPathName=\"%s\" %s " > + sprintf(command, "immcfg -a saLogStreamFileName=\"%s\" -a > saLogStreamPathName=. %s " > "2> /dev/null", fileName, > SA_LOG_STREAM_ALARM); > rc = system(command); > rc_validate(WEXITSTATUS(rc), 1); ------------------------------------------------------------------------------ _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
