Conform to ANSI C
This commit is contained in:
parent
842a5153a4
commit
7e7bfb2476
2
Makefile
2
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)
|
||||
|
@ -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);
|
||||
|
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user