Bug #11769 Updated: PDF_setcolor (invalid type of the third argument)

From: Date: Thu, 28 Jun 2001 17:46:20 +0000
Subject: Bug #11769 Updated: PDF_setcolor (invalid type of the third argument)
Groups: php.dev 
Request: Send a blank email to php-dev+get-58367@lists.php.net to get a copy of this message
ID: 11769 Updated by: sniper Reported By: cedric.scheyder@alcatel.fr Old-Status: Open Status: Closed Bug Type: PDF related Operating system: PHP Version: 4.0.5 Assigned To: Comments: Fixed in PHP 4.0.6 Previous Comments: --------------------------------------------------------------------------- [2001-06-28 05:06:08] cedric.scheyder@alcatel.fr in pdf.c file: PHP_FUNCTION(pdf_setcolor) { zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7; PDF *pdf; /* int c1; */ 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; } --------------------------------------------------------------------------- [2001-06-28 05:03:45] cedric.scheyder@alcatel.fr 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; } --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=11769&edit=2

« previous php.dev (#58367) next »