diff options
author | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2024-06-19 20:50:41 +0200 |
---|---|---|
committer | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2024-06-19 20:50:41 +0200 |
commit | 47984162974a8f7d9903d352567005ac569c5a87 (patch) | |
tree | ab265785ceaae0585aec80f6d5209e6289cbefd3 /include | |
parent | 9720c7efddf2d7595c9a0b021bc5fc6327c22bcf (diff) |
client: receive and display player list
Signed-off-by: Lizzy Fleckenstein <lizzy@vlhl.dev>
Diffstat (limited to 'include')
-rw-r--r-- | include/array.h | 2 | ||||
-rw-r--r-- | include/net.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/array.h b/include/array.h index 8d52619..5f81798 100644 --- a/include/array.h +++ b/include/array.h @@ -11,7 +11,7 @@ #define array(T) struct { size_t len; T *data; } #define arraybuf(T) struct { size_t cap; size_t len; T *data; } -#define ARR_REMOVE(A, P) memmove((P), (P)+1, --(A).len * sizeof *(P) - ((P) - (A).data)); +#define ARR_REMOVE(A, P) memmove((P), (P)+1, sizeof *(P) * (--(A).len - ((P) - (A).data))); #define ARR_APPEND(A) (((A).cap == (A).len) \ ? (A).data = realloc((A).data, sizeof *(A).data * ((A).cap = (A).cap ? (A).cap * 2 : 1)) \ : NULL, &((A).data)[(A).len++]) diff --git a/include/net.h b/include/net.h index ce2eb02..08c566a 100644 --- a/include/net.h +++ b/include/net.h @@ -46,7 +46,7 @@ typedef struct { ser_pkt_type(&pkt, TYPE); \ __VA_ARGS__ \ if (!peer_send(&(CONN), pkt.data, pkt.len)) \ - fprintf(stderr, "failed to send " #TYPE " to %*s\n", PSTR(*(CONN).name)); \ + fprintf(stderr, "failed to send " #TYPE " to %.*s\n", PSTR(*(CONN).name)); \ free(pkt.data); } void invalid_pkt(peer *p, str pkt); |