summaryrefslogtreecommitdiff
path: root/src/strings_func.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/strings_func.h')
-rw-r--r--src/strings_func.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/strings_func.h b/src/strings_func.h
index 67a26a1b8..2c7809d02 100644
--- a/src/strings_func.h
+++ b/src/strings_func.h
@@ -56,7 +56,7 @@ public:
offset(0),
num_param(size)
{
- assert(size <= parent.num_param - parent.offset);
+ assert(size <= parent.GetDataLeft());
if (parent.type == NULL) {
this->type = NULL;
} else {
@@ -89,6 +89,12 @@ public:
return &this->data[this->offset];
}
+ /** Return the amount of elements which can still be read. */
+ uint GetDataLeft() const
+ {
+ return this->num_param - this->offset;
+ }
+
/** Get a pointer to a specific element in the data array. */
uint64 *GetPointerToOffset(uint offset) const
{