diff --git a/src/GNUmakefile.common b/src/GNUmakefile.common index 3a25a9c..5aeae08 100644 --- a/src/GNUmakefile.common +++ b/src/GNUmakefile.common @@ -15,6 +15,9 @@ UUID:= ${DEPSDIR}/libuuid/.libs/libuuid.a all: magicka magimail magiedit ticproc mgpost magichat \ filecenter dosbox_shim magiftpd reset_pass +www: magickawww magimail magiedit ticproc mgpost magichat \ + filecenter dosbox_shim magiftpd reset_pass + ${LUA}: cd ${DEPSDIR}/lua && ${MAKE} -f Makefile ${DEPS_LUA_TARGET} MAKEFLAGS= CC=${CC} @@ -59,7 +62,7 @@ endif %.o: %.c ${HDRS} ${CC} -c -o $@ $< ${CFLAGS} -www: ${OBJS} ${WWWOBJS} ${LUA} ${ZMODEM} ${B64} ${JAMLIB} ${JSMN} ${UUID} +magickawww: ${OBJS} ${WWWOBJS} ${LUA} ${ZMODEM} ${B64} ${JAMLIB} ${JSMN} ${UUID} ${CC} -o ../magicka $^ ${LIBS} -lmicrohttpd magicka: ${OBJS} ${LUA} ${ZMODEM} ${JAMLIB} ${JSMN} ${UUID} @@ -70,7 +73,7 @@ magiedit: ${ODOORS} cd ${UTILSDIR}/magiedit && ${MAKE} magimail: ${JAMLIB} - cd ${UTILSDIR}/magimail && ${MAKE} + cd ${UTILSDIR}/magimail && ${MAKE} all ticproc: cd ${UTILSDIR}/ticproc && ${MAKE} @@ -93,7 +96,7 @@ magiftpd: reset_pass: cd ${UTILSDIR}/reset_pass && ${MAKE} -.PHONY: clean +.PHONY: clean www clean: rm -f ${OBJS} ${WWWOBJS} ../magicka diff --git a/src/GNUmakefile.freebsd b/src/GNUmakefile.freebsd index a21f66d..30ed892 100644 --- a/src/GNUmakefile.freebsd +++ b/src/GNUmakefile.freebsd @@ -1,4 +1,4 @@ -CC:= egcc +CC:= cc CFLAGS:= -std=gnu99 -I/usr/local/include LIBS:= -L/usr/local/lib -lsqlite3 -lutil -lm -lssl -lcrypto -lssh -liconv -lmosquitto diff --git a/src/util.c b/src/util.c index bd4e595..5b53b7b 100644 --- a/src/util.c +++ b/src/util.c @@ -162,8 +162,8 @@ int ptr_vector_append(struct ptr_vector *vec, void *p) { vec->capacity *= 2; ps = realloc(vec->ptrs, vec->capacity * sizeof(void *)); assert(ps != NULL); - memset(vec->ptrs + oldcap, 0, (vec->capacity - oldcap) * sizeof(void *)); vec->ptrs = ps; + memset(vec->ptrs + oldcap, 0, (vec->capacity - oldcap) * sizeof(void *)); } vec->ptrs[vec->len] = p; ++vec->len;