mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-07 23:51:22 +03:00
Unsigned format specifiers
This commit is contained in:
parent
3383de7938
commit
8ef45612dd
16
v/raft.c
16
v/raft.c
@ -399,7 +399,7 @@ _raft_rmsg_read(const u2_rbuf* buf_u, u2_rmsg* msg_u)
|
|||||||
red_i += sizeof(c3_d);
|
red_i += sizeof(c3_d);
|
||||||
|
|
||||||
if ( msg_u->len_d < 4 ) {
|
if ( msg_u->len_d < 4 ) {
|
||||||
uL(fprintf(uH, "raft: length too short (a) %lld\n", msg_u->len_d));
|
uL(fprintf(uH, "raft: length too short (a) %llu\n", msg_u->len_d));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,7 +410,7 @@ _raft_rmsg_read(const u2_rbuf* buf_u, u2_rmsg* msg_u)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( ben_d < red_i + 2 * sizeof(c3_w) ) {
|
if ( ben_d < red_i + 2 * sizeof(c3_w) ) {
|
||||||
uL(fprintf(uH, "raft: length too short (b) %lld\n", msg_u->len_d));
|
uL(fprintf(uH, "raft: length too short (b) %llu\n", msg_u->len_d));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
memcpy(&msg_u->tem_w, buf_u->buf_y + red_i, sizeof(c3_w));
|
memcpy(&msg_u->tem_w, buf_u->buf_y + red_i, sizeof(c3_w));
|
||||||
@ -425,7 +425,7 @@ _raft_rmsg_read(const u2_rbuf* buf_u, u2_rmsg* msg_u)
|
|||||||
}
|
}
|
||||||
case c3__rasp: {
|
case c3__rasp: {
|
||||||
if ( ben_d < red_i + sizeof(c3_w) ) {
|
if ( ben_d < red_i + sizeof(c3_w) ) {
|
||||||
uL(fprintf(uH, "raft: length too short (c) %lld\n", msg_u->len_d));
|
uL(fprintf(uH, "raft: length too short (c) %llu\n", msg_u->len_d));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
memcpy(&msg_u->rasp.suc_w, buf_u->buf_y + red_i, sizeof(c3_w));
|
memcpy(&msg_u->rasp.suc_w, buf_u->buf_y + red_i, sizeof(c3_w));
|
||||||
@ -434,7 +434,7 @@ _raft_rmsg_read(const u2_rbuf* buf_u, u2_rmsg* msg_u)
|
|||||||
}
|
}
|
||||||
case c3__apen: case c3__revo: {
|
case c3__apen: case c3__revo: {
|
||||||
if ( ben_d < red_i + sizeof(c3_d) + 2 * sizeof(c3_w) ) {
|
if ( ben_d < red_i + sizeof(c3_d) + 2 * sizeof(c3_w) ) {
|
||||||
uL(fprintf(uH, "raft: length too short (d) %lld\n", msg_u->len_d));
|
uL(fprintf(uH, "raft: length too short (d) %llu\n", msg_u->len_d));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
memcpy(&msg_u->rest.lai_d, buf_u->buf_y + red_i, sizeof(c3_d));
|
memcpy(&msg_u->rest.lai_d, buf_u->buf_y + red_i, sizeof(c3_d));
|
||||||
@ -445,7 +445,7 @@ _raft_rmsg_read(const u2_rbuf* buf_u, u2_rmsg* msg_u)
|
|||||||
red_i += sizeof(c3_w);
|
red_i += sizeof(c3_w);
|
||||||
|
|
||||||
if ( ben_d < red_i + 4 * msg_u->rest.nam_w ) {
|
if ( ben_d < red_i + 4 * msg_u->rest.nam_w ) {
|
||||||
uL(fprintf(uH, "raft: length too short (e) %lld\n", msg_u->len_d));
|
uL(fprintf(uH, "raft: length too short (e) %llu\n", msg_u->len_d));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
msg_u->rest.nam_c = malloc(4 * msg_u->rest.nam_w);
|
msg_u->rest.nam_c = malloc(4 * msg_u->rest.nam_w);
|
||||||
@ -458,7 +458,7 @@ _raft_rmsg_read(const u2_rbuf* buf_u, u2_rmsg* msg_u)
|
|||||||
|
|
||||||
if ( c3__apen == msg_u->typ_w ) {
|
if ( c3__apen == msg_u->typ_w ) {
|
||||||
if ( ben_d < red_i + 2 * sizeof(c3_d) ) {
|
if ( ben_d < red_i + 2 * sizeof(c3_d) ) {
|
||||||
uL(fprintf(uH, "raft: length too short (f) %lld\n", msg_u->len_d));
|
uL(fprintf(uH, "raft: length too short (f) %llu\n", msg_u->len_d));
|
||||||
red_i = -1;
|
red_i = -1;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@ -475,7 +475,7 @@ _raft_rmsg_read(const u2_rbuf* buf_u, u2_rmsg* msg_u)
|
|||||||
|
|
||||||
for ( i_d = 0; i_d < msg_u->rest.apen.ent_d; i_d++ ) {
|
for ( i_d = 0; i_d < msg_u->rest.apen.ent_d; i_d++ ) {
|
||||||
if ( ben_d < red_i + 3 * sizeof(c3_w) ) {
|
if ( ben_d < red_i + 3 * sizeof(c3_w) ) {
|
||||||
uL(fprintf(uH, "raft: length too short (g) %lld\n", msg_u->len_d));
|
uL(fprintf(uH, "raft: length too short (g) %llu\n", msg_u->len_d));
|
||||||
red_i = -1;
|
red_i = -1;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@ -486,7 +486,7 @@ _raft_rmsg_read(const u2_rbuf* buf_u, u2_rmsg* msg_u)
|
|||||||
memcpy(&ent_u[i_d].len_w, buf_u->buf_y + red_i, sizeof(c3_w));
|
memcpy(&ent_u[i_d].len_w, buf_u->buf_y + red_i, sizeof(c3_w));
|
||||||
red_i += sizeof(c3_w);
|
red_i += sizeof(c3_w);
|
||||||
if ( ben_d < red_i + 4 * ent_u[i_d].len_w ) {
|
if ( ben_d < red_i + 4 * ent_u[i_d].len_w ) {
|
||||||
uL(fprintf(uH, "raft: length too short (h) %lld\n", msg_u->len_d));
|
uL(fprintf(uH, "raft: length too short (h) %llu\n", msg_u->len_d));
|
||||||
red_i = -1;
|
red_i = -1;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user