Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
3da52798
...
3da52798917b92b79751c7eb9a0c1b721f167318
authored
2003-06-02 09:12:22 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(fetch_internaldate): Bugfix. Coredumped on invalid dates.
1 parent
beea97a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
imap4d/fetch.c
imap4d/fetch.c
View file @
3da5279
...
...
@@ -337,17 +337,25 @@ fetch_flags (struct fetch_command *command, char **arg)
static
int
fetch_internaldate
(
struct
fetch_command
*
command
,
char
**
arg
ARG_UNUSED
)
{
char
date
[
128
]
,
*
p
;
char
date
[
128
];
envelope_t
env
=
NULL
;
struct
tm
tm
;
struct
tm
tm
,
*
tmp
=
NULL
;
mu_timezone
tz
;
message_get_envelope
(
command
->
msg
,
&
env
);
date
[
0
]
=
'\0'
;
envelope_date
(
env
,
date
,
sizeof
(
date
),
NULL
);
p
=
date
;
mu_parse_ctime_date_time
((
const
char
**
)
&
p
,
&
tm
,
&
tz
);
strftime
(
date
,
sizeof
(
date
),
"%d-%b-%Y %H:%M:%S"
,
&
tm
);
if
(
envelope_date
(
env
,
date
,
sizeof
(
date
),
NULL
)
==
0
)
{
char
*
p
=
date
;
if
(
mu_parse_ctime_date_time
((
const
char
**
)
&
p
,
&
tm
,
&
tz
)
==
0
)
tmp
=
&
tm
;
}
if
(
!
tmp
)
{
time_t
t
=
time
(
NULL
);
tmp
=
localtime
(
&
t
);
}
strftime
(
date
,
sizeof
(
date
),
"%d-%b-%Y %H:%M:%S"
,
tmp
);
util_send
(
"%s"
,
command
->
name
);
util_send
(
"
\"
%s +0000
\"
"
,
date
);
return
RESP_OK
;
...
...
Please
register
or
sign in
to post a comment