forked from M-Labs/artiq
1
0
Fork 0

session.c: send_rpc_value: fix list serialization.

This commit is contained in:
whitequark 2015-08-09 20:36:14 +03:00
parent dfc91a35f2
commit b99eae6b3f
1 changed files with 2 additions and 3 deletions

View File

@ -771,13 +771,12 @@ static int send_rpc_value(const char **tag, void **value)
if(!out_packet_int32(list->length)) if(!out_packet_int32(list->length))
return 0; return 0;
const char *tag_copy = *tag;
for(int i = 0; i < list->length; i++) { for(int i = 0; i < list->length; i++) {
const char *tag_copy = *tag;
if(!send_rpc_value(&tag_copy, &element)) if(!send_rpc_value(&tag_copy, &element))
return 0; return 0;
tag_copy = *tag;
} }
*tag = tag_copy; skip_rpc_value(tag);
*value = (void*)((intptr_t)(*value) + sizeof(*list)); *value = (void*)((intptr_t)(*value) + sizeof(*list));
break; break;