** **
\*****************************************************************************/
-#include <stdio.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/resource.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-//#include <poll.h>
#include "main.h"
-static char *months[] = {
+static const char *months[] = {
"January", "February", "March", "April", "Mai", "June", "July",
"August", "September", "October", "November", "December"
};
fprintf(ph, "\n * date: %s %d %d %d:%02d\n\n", months[mon], mday, year+1900, hour, min);
/* attach audio file */
- if (filename[0])
- if ((fh = open(filename, O_RDONLY)))
+ if ((filename[0]) && ((fh = open(filename, O_RDONLY))))
{
while(strchr(filename, '/'))
filename = strchr(filename, '/')+1;
PDEBUG(DEBUG_EPOINT, "child process done for sending a mail\n");
/* exit process */
- memset(args, 0, sizeof(struct mail_args));
- free(args);
+ FREE(args, sizeof(struct mail_args));
amemuse--;
return(NULL);
}
struct mail_args *arg;
pthread_t tid;
- arg = (struct mail_args *)calloc(1, sizeof(struct mail_args));
- if (!arg)
- {
- PERROR("failed to alloc memory.\n");
- return;
- }
+ arg = (struct mail_args *)MALLOC(sizeof(struct mail_args));
amemuse++;
SCPY(arg->email, vbox_email);