diff --git a/Makefile b/Makefile index 9d1c03d..6cfa070 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PREFIX=/usr/local PREFIX_MAN=$(PREFIX)/man -CFLAGS?=-g -Wall -Wextra +CFLAGS?=-g -Wall -Wextra -pedantic all: snac diff --git a/xs.h b/xs.h index e5269a4..39b3b64 100644 --- a/xs.h +++ b/xs.h @@ -1070,7 +1070,7 @@ typedef struct { int size; /* size of full dict (_XS_TYPE_SIZE) */ int first; /* first node for sequential search */ int root; /* root node for hashed search */ - ditem_hdr ditems[]; /* the ditems */ + /* a bunch of ditem_hdr and value follows */ } dict_hdr; diff --git a/xs_random.h b/xs_random.h index d076cc2..78de32a 100644 --- a/xs_random.h +++ b/xs_random.h @@ -66,7 +66,8 @@ void *xs_rnd_buf(void *buf, int size) /* fill with full integers */ while (n--) { xs_rnd_int32_d(&s); - p = memcpy(p, &s, sizeof(s)) + sizeof(s); + memcpy(p, &s, sizeof(s)); + p += sizeof(s); } if ((n = size % sizeof(s))) { diff --git a/xs_url.h b/xs_url.h index d9491ab..1738634 100644 --- a/xs_url.h +++ b/xs_url.h @@ -17,7 +17,7 @@ xs_str *xs_url_dec(const char *str) while (*str) { if (*str == '%') { - int i; + unsigned int i; if (sscanf(str + 1, "%02x", &i) == 1) { unsigned char uc = i;