File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 19
19
20
20
#include <php.h>
21
21
#include <Zend/zend_interfaces.h>
22
+ #include <Zend/zend_long.h>
22
23
23
24
#include "php_array_api.h"
24
25
@@ -91,6 +92,7 @@ static bool php_phongo_bulkwritecommandresult_get_writeerrors(php_phongo_bulkwri
91
92
uint32_t len ;
92
93
const uint8_t * data ;
93
94
zval write_error ;
95
+ zend_ulong index ;
94
96
95
97
if (!BSON_ITER_HOLDS_DOCUMENT (& iter )) {
96
98
continue ;
@@ -102,12 +104,14 @@ static bool php_phongo_bulkwritecommandresult_get_writeerrors(php_phongo_bulkwri
102
104
continue ;
103
105
}
104
106
105
- if (!phongo_writeerror_init_ex (& write_error , & bson , atoi (bson_iter_key (& iter )))) {
107
+ index = (zend_ulong ) ZEND_STRTOUL (bson_iter_key (& iter ), NULL , 10 );
108
+
109
+ if (!phongo_writeerror_init_ex (& write_error , & bson , (int32_t ) index )) {
106
110
zval_ptr_dtor (& write_error );
107
111
continue ;
108
112
}
109
113
110
- add_next_index_zval (return_value , & write_error );
114
+ add_index_zval (return_value , index , & write_error );
111
115
}
112
116
113
117
return true;
You can’t perform that action at this time.
0 commit comments