From d49db7d0981861d979765647cce3c6468a012301 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 2 Mar 2020 16:19:08 -0500 Subject: Refactor startswith() and endswidth() usage --- src/mime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mime.c') diff --git a/src/mime.c b/src/mime.c index c4d8c42..78c5ba0 100644 --- a/src/mime.c +++ b/src/mime.c @@ -103,7 +103,7 @@ int file_is_text(const char *filename) { int result = 0; char *path = normpath(filename); Mime *type = file_mimetype(path); - if (startswith(type->type, "text/") == 0) { + if (startswith(type->type, "text/")) { result = 1; } free(path); @@ -120,7 +120,7 @@ int file_is_binary(const char *filename) { int result = 0; char *path = normpath(filename); Mime *type = file_mimetype(path); - if (startswith(type->type, "application/") == 0 && strcmp(type->charset, "binary") == 0) { + if (startswith(type->type, "application/") && strcmp(type->charset, "binary") == 0) { result = 1; } free(path); -- cgit