mirror of
https://github.com/fumiama/simple-protobuf.git
synced 2026-06-08 18:10:28 +08:00
优化错误处理
This commit is contained in:
4
test.c
4
test.c
@@ -31,10 +31,10 @@ int main() {
|
||||
fp = NULL;
|
||||
fp = fopen("test.sp", "rb");
|
||||
if(fp) {
|
||||
SIMPLE_PB* spb = get_pb(fp);
|
||||
simple_pb_t* spb = get_pb(fp);
|
||||
memcpy(&t, spb->target, sizeof(struct TEST));
|
||||
printf("a:%u\nb:%u\nc:%u\nd:%llu\ne:%s\n", t.a, t.b, t.c, t.d, t.e);
|
||||
printf("Struct size: %u, read: %u\n", spb->struct_len, spb->real_len);
|
||||
} else perror("[SPB]");
|
||||
} else perror("[SPB]");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user