summaryrefslogtreecommitdiff
path: root/xs.h
diff options
context:
space:
mode:
authorLouis Brauer <louis@openbooking.ch>2024-05-27 12:25:38 +0200
committerLouis Brauer <louis@openbooking.ch>2024-05-27 12:25:38 +0200
commit4621a25ba476b8222b7fca8b545ad2489469f310 (patch)
treef6a406c42e5e8faae255d988505d654a29c188dc /xs.h
parent81cf309e4d0ba6c2debccc21ea4f85e1e6245dc5 (diff)
parent36764b8ade5ee4686b04acb251f586eec4dacfad (diff)
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'xs.h')
-rw-r--r--xs.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/xs.h b/xs.h
index 972665c..56771e1 100644
--- a/xs.h
+++ b/xs.h
@@ -277,7 +277,7 @@ int _xs_get_size(const xs_val *ptr)
/* must match _XS_TYPE_SIZE */
{
int i;
- memcpy(&i, ptr, sizeof(i));
+ memcpy(&i, ptr + 1, sizeof(i));
return i;
}
@@ -299,7 +299,7 @@ int xs_size(const xs_val *data)
case XSTYPE_LIST:
case XSTYPE_DICT:
case XSTYPE_DATA:
- len = _xs_get_size(data + 1);
+ len = _xs_get_size(data);
break;
@@ -1286,7 +1286,7 @@ xs_data *xs_data_new(const void *data, int size)
int xs_data_size(const xs_data *value)
/* returns the size of the data stored inside value */
{
- return _xs_get_size(value + 1) - (1 + _XS_TYPE_SIZE);
+ return _xs_get_size(value) - (1 + _XS_TYPE_SIZE);
}