1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00
This commit is contained in:
Georgi Kodinov
2013-03-28 17:41:22 +02:00
2 changed files with 55 additions and 23 deletions

View File

@ -339,14 +339,17 @@ protected:
Need to perform the calculation in logical units, since multiplication
can overflow the size data type.
@arg data pointer to the begining of the points array
@arg expected_points number of points expected
@arg data pointer to the begining of the points array
@arg expected_points number of points expected
@arg extra_point_space extra space for each point element in the array
@return true if there are not enough points
*/
inline bool not_enough_points(const char *data, uint32 expected_points) const
inline bool not_enough_points(const char *data, uint32 expected_points,
uint32 extra_point_space = 0) const
{
return (m_data_end < data ||
(expected_points > ((m_data_end - data) / POINT_DATA_SIZE)));
(expected_points > ((m_data_end - data) /
(POINT_DATA_SIZE + extra_point_space))));
}
const char *m_data;
const char *m_data_end;