From:             [EMAIL PROTECTED]
Operating system: Solaris 2.8
PHP version:      4.0.5
PHP Bug Type:     PDF related
Bug description:  PDF_setcolor (invalid type of the third argument)

PHP_FUNCTION(pdf_setcolor) {
        zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7;
        PDF *pdf;




        float c1;     <========== TO BE MODIFIED !!!!!!!!!! (replace the int by a 
float)




        if (ZEND_NUM_ARGS() != 7 || zend_get_parameters_ex(7, &arg1, &arg2, &arg3, 
&arg4, &arg5, &arg6, &arg7) == FAILURE) {
                WRONG_PARAM_COUNT;
        }

        ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);

        convert_to_string_ex(arg2);
        convert_to_string_ex(arg3);
        convert_to_double_ex(arg4);
        convert_to_double_ex(arg5);
        convert_to_double_ex(arg6);
        convert_to_double_ex(arg7);

        if (0 == (strcmp(Z_STRVAL_PP(arg3), "spot"))) {
            c1 = (int) Z_DVAL_PP(arg4)-PDFLIB_SPOT_OFFSET;
        } else if(0 == (strcmp(Z_STRVAL_PP(arg3), "pattern"))) {
            c1 = (int) Z_DVAL_PP(arg4)-PDFLIB_PATTERN_OFFSET;
        } else {
            c1 = (float) Z_DVAL_PP(arg4);
        }

        PDF_setcolor(pdf,
                Z_STRVAL_PP(arg2),
                Z_STRVAL_PP(arg3),
                (float) c1,
                (float) Z_DVAL_PP(arg5),
                (float) Z_DVAL_PP(arg6),
                (float) Z_DVAL_PP(arg7));

        RETURN_TRUE;
}



-- 
Edit Bug report at: http://bugs.php.net/?id=11769&edit=1



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to