youdontcare |
tiens histoire de te rassurer, le bout de source 'incriminé' : ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2)
{
zval op1_copy, op2_copy;
if (op1->type == IS_STRING && op2->type == IS_STRING) {
zval *longer, *shorter;
char *result_str;
int i, result_len;
if (op1->value.str.len >= op2->value.str.len) {
longer = op1;
shorter = op2;
} else {
longer = op2;
shorter = op1;
}
result->type = IS_STRING;
result_len = shorter->value.str.len;
result_str = estrndup(shorter->value.str.val, shorter->value.str.len);
for (i = 0; i < shorter->value.str.len; i++) {
result_str[i] ^= longer->value.str.val[i];
}
if (result==op1) {
efree(result->value.str.val);
}
result->value.str.val = result_str;
result->value.str.len = result_len;
return SUCCESS;
}
zendi_convert_to_long(op1, op1_copy, result);
zendi_convert_to_long(op2, op2_copy, result); result->type = IS_LONG;
result->value.lval = op1->value.lval ^ op2->value.lval; return SUCCESS;
}
comme tu peux le voir, tout va bien. cherche une vraie solution au problème plutôt que de te faire une fonction custom (!). |