diff --git a/Makefile b/Makefile index df1c1e0..fadd28f 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,8 @@ OBJ_FILES := $(patsubst $(SD)/%.c,$(BD)/%.o,$(SRC_FILES)) INCLUDE_DIRS = -Ilibs/qments/include -Ilibs/cgic LIB_TARGETS = $(patsubst $(LIBS_DIR)/%,$(BD)/lib%.a,$(LIBS)) +CFLAGS ?= -O2 -ansi -pedantic + $(BD)/libcgic.a: $(MAKE) -C $(LIBS_DIR)/cgic cp $(LIBS_DIR)/cgic/libcgic.a $(BD) diff --git a/src/main.c b/src/main.c index 9533bf3..bb94cde 100644 --- a/src/main.c +++ b/src/main.c @@ -166,6 +166,7 @@ handle_submitted_comment() char displayname[MAX_NAME], text[MAX_COMMENT_SIZE], *sanitized_text; int rid, retval; cgiFormResultType err; + CommentHeader header; Driver driver = DRIVER; UnixFsDriverData driver_data = DRIVER_DATA; @@ -199,7 +200,6 @@ handle_submitted_comment() sanitized_text = mk_specialchars(text); - CommentHeader header; time(&header.creation_time); header.reply_id = rid; header.text_length = strlen(sanitized_text); diff --git a/src/string_buffer.c b/src/string_buffer.c index cda94d2..0aa16a4 100644 --- a/src/string_buffer.c +++ b/src/string_buffer.c @@ -32,7 +32,8 @@ sb_length(const StringBuffer *buffer) void sb_to_c_str(const StringBuffer *buffer, char *str) { - for (size_t i = 0; i < buffer->size; ++i) { + size_t i; + for (i = 0; i < buffer->size; ++i) { str[i] = buffer->buf[i]; } str[buffer->size] = '\0';