Patch by Howard Chu, hyc at highlandsun dot com
Originally committed as revision 23154 to svn://svn.ffmpeg.org/ffmpeg/trunk
{
const char *str;
time_t ti;
- char *p;
+ struct tm *tm;
char buf2[32];
switch(error_number) {
/* output GMT time */
ti = time(NULL);
- p = ctime(&ti);
- strcpy(buf2, p);
- p = buf2 + strlen(p) - 1;
- if (*p == '\n')
- *p = '\0';
+ tm = gmtime(&ti);
+ strftime(buf2, sizeof(buf2), "%a, %d %b %Y %H:%M:%S", tm);
url_fprintf(c->pb, "Date: %s GMT\r\n", buf2);
}