From 94bc1e381baacba8a45f5782f368af11eff279a7 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 15 Dec 2019 19:33:19 +0100 Subject: badwolf.c: Fix access() usage --- Makefile | 2 +- badwolf.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a215292..f2c5cee 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ DOCS = usr.bin.badwolf README.md KnowledgeBase.md CC = cc CFLAGS = -g -Wall -Wextra -Wconversion -Wsign-conversion -CDEPS = `pkg-config --cflags $(DEPS)` -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_DEFAULT_SOURCE -DVERSION=\"$(VERSION_FULL)\" +CDEPS = `pkg-config --cflags $(DEPS)` -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" LIBS = `pkg-config --libs $(DEPS)` all: $(EXE) $(TRANS) diff --git a/badwolf.c b/badwolf.c index bf42eb2..909df75 100644 --- a/badwolf.c +++ b/badwolf.c @@ -11,7 +11,8 @@ #include /* g_fprintf() */ #include /* soup* */ #include /* LC_* */ -#include /* realpath(), malloc() */ +#include /* malloc() */ +#include /* access() */ const gchar *homepage = "https://hacktivis.me/projects/badwolf"; const gchar *version = VERSION; @@ -67,7 +68,7 @@ badwolf_ensure_uri_scheme(const gchar *text, gboolean try_file) { SoupURI *uri = soup_uri_new(text); - if(uri->path == NULL) + if(uri->path == NULL || text == NULL) { soup_uri_free(uri); return "about:blank"; -- cgit v1.3.1-23-gd82d