Skip to content

Commit

Permalink
Merge pull request #1135 from skliper/fix1134-writetosyslog_utdebug
Browse files Browse the repository at this point in the history
Fix #1134, Add UtDebug output to CFE_ES_WriteToSysLog stub
  • Loading branch information
astrogeco authored Jan 26, 2021
2 parents 79cfde6 + 383438d commit a991e96
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions fsw/cfe-core/ut-stubs/ut_es_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,21 @@ int32 CFE_ES_WriteToSysLog(const char *SpecStringPtr, ...)

int32 status;
va_list va;
char str[128];
char *newline;

va_start(va,SpecStringPtr);
vsnprintf(str, sizeof(str), SpecStringPtr, va);

/* Replace newline since UtDebug already adds one */
newline = strchr(str, '\n');
if (newline != NULL)
{
*newline = '\0';
}

UtDebug("CFE_ES_WriteToSysLog: %s", str);
va_end(va);

va_start(va,SpecStringPtr);
status = UT_DEFAULT_IMPL_VARARGS(CFE_ES_WriteToSysLog, va);
Expand Down

0 comments on commit a991e96

Please sign in to comment.