/* Read Output of commands */
void *read_fullcommand(int pos, int *rc, int drop_it)
{
/* Read Output of commands */
void *read_fullcommand(int pos, int *rc, int drop_it)
{
merror("%s: ERROR: Unable to execute command: '%s'.",
ARGV0, logff[pos].command);
logff[pos].command = NULL;
merror("%s: ERROR: Unable to execute command: '%s'.",
ARGV0, logff[pos].command);
logff[pos].command = NULL;
snprintf(str, 256, "ossec: output: '%s':\n",
snprintf(str, 256, "ossec: output: '%s':\n",
cmd_size = strlen(str);
n = fread(str + cmd_size, 1, OS_MAXSTR - OS_LOG_HEADER - 256, cmd_output);
cmd_size = strlen(str);
n = fread(str + cmd_size, 1, OS_MAXSTR - OS_LOG_HEADER - 256, cmd_output);
- /* Getting the last occurence of \n */
- if ((p = strrchr(str, '\n')) != NULL)
- {
+ /* Get the last occurrence of \n */
+ if ((p = strrchr(str, '\n')) != NULL) {
-
- /* Sending message to queue */
- if(drop_it == 0)
- {
- if(SendMSG(logr_queue,strfinal,
+ /* Send message to queue */
+ if (drop_it == 0) {
+ if (SendMSG(logr_queue, strfinal,