.gitignore: add ctags file

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
main.c: fix -Wincompatible-pointer-types

Fix warning: passing 'char **' to parameter of type 'const char **' discards
qualifiers in nested pointer types [-Wincompatible-pointer-types]

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
chat.c: fix format argument type

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
civetweb.c: fix realloc handling

Fix handling of realloc. If realloc() fails it returns NULL, assigning
the return value of realloc() directly to the pointer without checking
for the result will lead to a memory leak in error case.

Use a temporary pointer to hold the result of realloc().

Fix for:
[src/civetweb.c:409]: (error) Common realloc mistake: 'data' nulled but
not freed upon failure

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
civetweb.c: check array limit before access array

Fix for:
[src/civetweb.c:2338]: (style) Array index 'i' is used before limits check.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CivetServer.cpp: check array limit before access array

Fix for:

[src/CivetServer.cpp:153]: (style) Array index 'i' is used before
limits check.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
unit_test.c: fix printf, remove unused parameter

Fix for:
[test/unit_test.c:827]: (warning) printf format string requires 0
 parameters but 1 is given.
[test/unit_test.c:833]: (warning) printf format string requires 0
 parameters but 1 is given.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mod_lua.inl: Clarify expression with parentheses

Fix for:
[src/mod_lua.inl:899]: (style) Suspicious condition (assignment +
 comparison); Clarify expression with parenth

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
civetweb.c: fix sprintf format specifier

Change %u to %lu and cast size_t to unsigned long to fix:

[src/civetweb.c:360]: (warning) %u in format string (no. 2) requires
 'unsigned int' but the argument type is 'size_t {aka unsigned long}'.
[src/civetweb.c:360]: (warning) %u in format string (no. 3) requires
 'unsigned int' but the argument type is 'unsigned long'.
[src/civetweb.c:360]: (warning) %u in format string (no. 4) requires
 'unsigned int' but the argument type is 'unsigned long'.
[src/civetweb.c:388]: (warning) %u in format string (no. 2) requires
 'unsigned int' but the argument type is 'size_t {aka unsigned long}'.
[src/civetweb.c:388]: (warning) %u in format string (no. 3) requires
 'unsigned int' but the argument type is 'unsigned long'.
[src/civetweb.c:388]: (warning) %u in format string (no. 4) requires
 'unsigned int' but the argument type is 'unsigned long'.
[src/civetweb.c:414]: (warning) %u in format string (no. 2) requires
 'unsigned int' but the argument type is 'size_t {aka unsigned long}'.
[src/civetweb.c:414]: (warning) %u in format string (no. 3) requires
 'unsigned int' but the argument type is 'unsigned long'.
[src/civetweb.c:414]: (warning) %u in format string (no. 4) requires
 'unsigned int' but the argument type is 'unsigned long'.
[src/civetweb.c:421]: (warning) %u in format string (no. 2) requires
 'unsigned int' but the argument type is 'size_t {aka unsigned long}'.
[src/civetweb.c:421]: (warning) %u in format string (no. 3) requires
 'unsigned int' but the argument type is 'unsigned long'.
[src/civetweb.c:421]: (warning) %u in format string (no. 4) requires
 'unsigned int' but the argument type is 'unsigned long'.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
civetweb.c: fix format string from %d to %u

[src/civetweb.c:366]: (warning) %d in format string (no. 4) requires
 'int' but the argument type is 'unsigned int'.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
civetweb.c: fix sscanf format string to %u

[src/civetweb.c:5728]: (warning) %d in format string (no. 2) requires
 'int *' but the argument type is 'unsigned int *'.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
civetweb.c: check array limits before access array

[src/civetweb.c:3250]: (style) Array index 'i' is used before limits check.
[src/civetweb.c:3254]: (style) Array index 'i' is used before limits check.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
civetweb.c: change some local functions to static

Fix for cgcc warning:

src/civetweb.c:6189:22: warning: symbol 'mg_connect' was not declared.
  Should it be static?

src/civetweb.c:6743:6: warning: symbol 'get_system_name' was not declared.
 Should it be static?

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
main.c: use NULL for pointer

fix for cgcc warning:

src/main.c:238:48: warning: Using plain integer as NULL pointer
src/main.c:246:44: warning: Using plain integer as NULL pointer
src/main.c:418:17: warning: Using plain integer as NULL pointer

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
civetweb.c: use NULL for pointers

fix for cgcc warnings:

src/civetweb.c:5455:56: warning: Using plain integer as NULL pointer
src/civetweb.c:5696:28: warning: Using plain integer as NULL pointer
src/civetweb.c:5698:26: warning: Using plain integer as NULL pointer
src/civetweb.c:6456:34: warning: Using plain integer as NULL pointer
src/civetweb.c:6643:34: warning: Using plain integer as NULL pointer
src/civetweb.c:6811:29: warning: Using plain integer as NULL pointer

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Error4xx page should be an error404 page. The error 403 (e.g., list a directory if enable_directory_listing no is configured) will show the error.lua page
Show syntax errors in .htpasswd files
civetweb.c: check for array boundry before read

Added assert to while loop to make sure not to read over the array boundry.

Fix for Coverity issue from Ceph project:

CID 1160832 (#1 of 1): Out-of-bounds read (OVERRUN_STATIC)
 37. overrun-local: Overrunning static array "buf", with 8192
 elements, at position 8192 with index variable "len".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
main.c: move 'guard' variable to _WIN32

Only needed in _WIN32 case. Otherwise unused.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Allow includes in htpasswd files