Merge branch 'master' into develop

This commit is contained in:
Enno Rehling 2017-02-12 20:08:29 +01:00
commit e9ca536e8e
1 changed files with 4 additions and 1 deletions

View File

@ -38,7 +38,10 @@ static void a_writekeys(const attrib *a, const void *o, storage *store) {
static int a_readkeys(attrib * a, void *owner, gamedata *data) { static int a_readkeys(attrib * a, void *owner, gamedata *data) {
int i, *p = 0; int i, *p = 0;
READ_INT(data->store, &i); READ_INT(data->store, &i);
assert(i < 4096 && i>0); assert(i < 4096 && i>=0);
if (i == 0) {
return AT_READ_FAIL;
}
a->data.v = p = malloc(sizeof(int)*(i + 1)); a->data.v = p = malloc(sizeof(int)*(i + 1));
*p++ = i; *p++ = i;
while (i--) { while (i--) {