Browse Source

remove unused extension and fix warnings

master
prx 12 months ago
committed by Solene Rapenne
parent
commit
4e82f1e44c
  1. 2
      Makefile
  2. 3
      main.c
  3. 2
      mimes.c

2
Makefile

@ -1,4 +1,6 @@
PREFIX?=/usr/local/
CFLAGS += -pedantic -Wall -Wextra -Wmissing-prototypes \
-Wstrict-prototypes -Wwrite-strings
all: vger

3
main.c

@ -97,7 +97,6 @@ display_file(const char *path, const char *lang)
struct stat sb;
ssize_t nread;
char *buffer[BUFSIZ];
char extension[10];
const char *file_mime;
/* this is to check if path is a directory */
@ -211,7 +210,7 @@ main(int argc, char **argv)
if (pos != NULL) {
/* if there is a / found */
int position = -1;
for (int i = 0; i < sizeof(request); i++) {
for (size_t i = 0; i < sizeof(request); i++) {
if (*pos == request[i]) {
position = i;
break;

2
mimes.c

@ -120,7 +120,7 @@ static const struct {
const char *
get_file_mime(const char *path)
{
int i;
size_t i;
char *extension;
if ((extension = strrchr(path, '.')) == NULL)

Loading…
Cancel
Save