File tree 1 file changed +3
-4
lines changed 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ PHP_METHOD(Random_Randomizer, getBytes)
142
142
zend_string * retval ;
143
143
zend_long length ;
144
144
uint64_t result ;
145
- size_t total_size = 0 , required_size ;
145
+ size_t total_size = 0 ;
146
146
147
147
ZEND_PARSE_PARAMETERS_START (1 , 1 )
148
148
Z_PARAM_LONG (length )
@@ -154,17 +154,16 @@ PHP_METHOD(Random_Randomizer, getBytes)
154
154
}
155
155
156
156
retval = zend_string_alloc (length , 0 );
157
- required_size = length ;
158
157
159
- while (total_size < required_size ) {
158
+ while (total_size < length ) {
160
159
result = randomizer -> algo -> generate (randomizer -> status );
161
160
if (EG (exception )) {
162
161
zend_string_free (retval );
163
162
RETURN_THROWS ();
164
163
}
165
164
for (size_t i = 0 ; i < randomizer -> status -> last_generated_size ; i ++ ) {
166
165
ZSTR_VAL (retval )[total_size ++ ] = (result >> (i * 8 )) & 0xff ;
167
- if (total_size >= required_size ) {
166
+ if (total_size >= length ) {
168
167
break ;
169
168
}
170
169
}
You can’t perform that action at this time.
0 commit comments