In g_ril_reply_parse_get_calls, we have 13 calls to parce_r_*, and one of them is for reading a string, which complicates checking the remaining bytes and makes it ugly and error prone. I am thinking about a more general mechanism, I will mail you some sort of proposal.