summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/array.h2
-rw-r--r--include/net.h2
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);