1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 08:58:28 +02:00

MFB: Use thread-safe code

This commit is contained in:
Ilia Alshanetsky
2006-11-30 15:13:33 +00:00
parent b0f688006d
commit 55ebcb9f7e
+9 -6
View File
@@ -1755,12 +1755,15 @@ static void mprint(union VALUETYPE *p, struct magic *m)
case DATE:
case BEDATE:
case LEDATE:
/* XXX: not multithread safe */
pp = ctime((time_t *) & p->l);
if ((rt = strchr(pp, '\n')) != NULL)
*rt = '\0';
(void) magic_rsl_printf(m->desc, pp);
return;
{
char ctimebuf[52];
pp = php_ctime_r((time_t *) &p->l, ctimebuf);
if ((rt = strchr(pp, '\n')) != NULL) {
*rt = '\0';
}
(void) magic_rsl_printf(m->desc, pp);
return;
}
default:
{
TSRMLS_FETCH();