Merge branch 'master' of ssh://git.magickabbs.com/home/andrew/repositories/MagickaBBS

This commit is contained in:
Andrew Pamment 2018-10-11 11:47:53 +10:00
commit e196292503
3 changed files with 8 additions and 5 deletions

View File

@ -15,6 +15,9 @@ UUID:= ${DEPSDIR}/libuuid/.libs/libuuid.a
all: magicka magimail magiedit ticproc mgpost magichat \ all: magicka magimail magiedit ticproc mgpost magichat \
filecenter dosbox_shim magiftpd reset_pass filecenter dosbox_shim magiftpd reset_pass
www: magickawww magimail magiedit ticproc mgpost magichat \
filecenter dosbox_shim magiftpd reset_pass
${LUA}: ${LUA}:
cd ${DEPSDIR}/lua && ${MAKE} -f Makefile ${DEPS_LUA_TARGET} MAKEFLAGS= CC=${CC} cd ${DEPSDIR}/lua && ${MAKE} -f Makefile ${DEPS_LUA_TARGET} MAKEFLAGS= CC=${CC}
@ -59,7 +62,7 @@ endif
%.o: %.c ${HDRS} %.o: %.c ${HDRS}
${CC} -c -o $@ $< ${CFLAGS} ${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 ${CC} -o ../magicka $^ ${LIBS} -lmicrohttpd
magicka: ${OBJS} ${LUA} ${ZMODEM} ${JAMLIB} ${JSMN} ${UUID} magicka: ${OBJS} ${LUA} ${ZMODEM} ${JAMLIB} ${JSMN} ${UUID}
@ -70,7 +73,7 @@ magiedit: ${ODOORS}
cd ${UTILSDIR}/magiedit && ${MAKE} cd ${UTILSDIR}/magiedit && ${MAKE}
magimail: ${JAMLIB} magimail: ${JAMLIB}
cd ${UTILSDIR}/magimail && ${MAKE} cd ${UTILSDIR}/magimail && ${MAKE} all
ticproc: ticproc:
cd ${UTILSDIR}/ticproc && ${MAKE} cd ${UTILSDIR}/ticproc && ${MAKE}
@ -93,7 +96,7 @@ magiftpd:
reset_pass: reset_pass:
cd ${UTILSDIR}/reset_pass && ${MAKE} cd ${UTILSDIR}/reset_pass && ${MAKE}
.PHONY: clean .PHONY: clean www
clean: clean:
rm -f ${OBJS} ${WWWOBJS} ../magicka rm -f ${OBJS} ${WWWOBJS} ../magicka

View File

@ -1,4 +1,4 @@
CC:= egcc CC:= cc
CFLAGS:= -std=gnu99 -I/usr/local/include CFLAGS:= -std=gnu99 -I/usr/local/include
LIBS:= -L/usr/local/lib -lsqlite3 -lutil -lm -lssl -lcrypto -lssh -liconv -lmosquitto LIBS:= -L/usr/local/lib -lsqlite3 -lutil -lm -lssl -lcrypto -lssh -liconv -lmosquitto

View File

@ -162,8 +162,8 @@ int ptr_vector_append(struct ptr_vector *vec, void *p) {
vec->capacity *= 2; vec->capacity *= 2;
ps = realloc(vec->ptrs, vec->capacity * sizeof(void *)); ps = realloc(vec->ptrs, vec->capacity * sizeof(void *));
assert(ps != NULL); assert(ps != NULL);
memset(vec->ptrs + oldcap, 0, (vec->capacity - oldcap) * sizeof(void *));
vec->ptrs = ps; vec->ptrs = ps;
memset(vec->ptrs + oldcap, 0, (vec->capacity - oldcap) * sizeof(void *));
} }
vec->ptrs[vec->len] = p; vec->ptrs[vec->len] = p;
++vec->len; ++vec->len;