Skip to content

Commit b38e642

Browse files
committed
Merge pull request #364
2 parents e33304d + b4c907d commit b38e642

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/BSON/UTCDateTime.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static bool php_phongo_utcdatetime_init_from_string(php_phongo_utcdatetime_t *in
7171
errno = 0;
7272

7373
#if defined(PHP_WIN32)
74-
milliseconds = _atoi64(s);
74+
milliseconds = _atoi64(s_milliseconds);
7575
#else
7676
milliseconds = bson_ascii_strtoll(s_milliseconds, &endptr, 10);
7777
#endif
@@ -370,6 +370,11 @@ HashTable *php_phongo_utcdatetime_get_properties(zval *object TSRMLS_DC) /* {{{
370370
php_phongo_utcdatetime_t *intern;
371371
HashTable *props;
372372

373+
#if SIZEOF_LONG == 4
374+
char s_milliseconds[24];
375+
int s_milliseconds_len;
376+
#endif
377+
373378
intern = Z_UTCDATETIME_OBJ_P(object);
374379
props = zend_std_get_properties(object TSRMLS_CC);
375380

@@ -378,12 +383,7 @@ HashTable *php_phongo_utcdatetime_get_properties(zval *object TSRMLS_DC) /* {{{
378383
}
379384

380385
#if SIZEOF_LONG == 4
381-
{
382-
char s_milliseconds[24];
383-
int s_milliseconds_len;
384-
385-
s_milliseconds_len = snprintf(s_milliseconds, sizeof(s_milliseconds), "%" PRId64, intern->milliseconds);
386-
}
386+
s_milliseconds_len = snprintf(s_milliseconds, sizeof(s_milliseconds), "%" PRId64, intern->milliseconds);
387387
#endif
388388

389389
#if PHP_VERSION_ID >= 70000

0 commit comments

Comments
 (0)