From: Baptiste Daroussin Date: Sat, 15 Apr 2023 19:26:20 +0000 (+0200) Subject: findit: convert to boolean X-Git-Tag: RELEASE_1_4_0b1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbf37daeea48435128ba908a7c3c8fcfba30ca6c;p=thirdparty%2Fmlmmj.git findit: convert to boolean --- diff --git a/include/do_all_the_voodoo_here.h b/include/do_all_the_voodoo_here.h index 1a631073..d4a7cfde 100644 --- a/include/do_all_the_voodoo_here.h +++ b/include/do_all_the_voodoo_here.h @@ -1,6 +1,6 @@ -/* Copyright (C) 2004 Mads Martin Joergensen - * - * $Id$ +/* + * Copyright (C) 2004 Mads Martin Joergensen + * Copyright (C) 2023 Baptiste Daroussin * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -21,15 +21,12 @@ * IN THE SOFTWARE. */ -#ifndef DO_ALL_THE_VOODOO_HERE_H -#define DO_ALL_THE_VOODOO_HERE_H +#pragma once #include "mlmmj.h" /* For struct mailhdr and struct strlist */ -int findit(const char *line, const strlist *headers); +bool findit(const char *line, const strlist *headers); void getinfo(const char *line, struct mailhdr *readhdrs); int do_all_the_voodoo_here(int infd, int outfd, int hdrfd, int footfd, const strlist *delhdrs, struct mailhdr *readhdrs, strlist *allhdrs, const char *subjectprefix); - -#endif /* DO_ALL_THE_VOODOO_HERE_H */ diff --git a/src/do_all_the_voodoo_here.c b/src/do_all_the_voodoo_here.c index c83e3ea2..2d38bfc0 100644 --- a/src/do_all_the_voodoo_here.c +++ b/src/do_all_the_voodoo_here.c @@ -35,7 +35,7 @@ #include "log_error.h" #include "wrappers.h" -int +bool findit(const char *line, const strlist *headers) { size_t len; @@ -43,10 +43,10 @@ findit(const char *line, const strlist *headers) tll_foreach(*headers, it) { len = strlen(it->item); if(strncasecmp(line, it->item, len) == 0) - return 1; + return true; } - return 0; + return false; } void getinfo(const char *line, struct mailhdr *readhdrs)