was fixed by running Asterisk under valgrind.
(closes issue #10746, reported by arcivanov, patched by me)
*** IMPORTANT NOTE: We need to check to see if this same bug exists elsewhere.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82644
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
#define ENDL "\n"
#endif
+ memset(&tm, 0, sizeof(tm));
+
gethostname(host, sizeof(host) - 1);
if (strchr(srcemail, '@'))
ast_copy_string(who, srcemail, sizeof(who));
{
struct tm tm;
time_t t;
- t = time(0);
+
+ time(&t);
+ memset(&tm, 0, sizeof(tm));
+
ast_localtime(&t, &tm, NULL);
+
return strftime(s, len, "%a %b %e %r %Z %Y", &tm);
}