diff options
author | Omar Polo <op@omarpolo.com> | 2021-02-12 12:47:20 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2021-02-12 12:47:20 +0000 |
commit | 52418c8d828bc25e0e84cc25d5e349a84be0b397 (patch) | |
tree | 480166acacfecd667dcd69e68df8f6a305792277 | |
parent | 3cb3dd4d422cdead2dd09f1e3ce3eff35a9e6dc8 (diff) |
fix various compilation errors
Include gmid.h as first header in every file, as it then includes
config.h (that defines _GNU_SOURCE for instance).
Fix also a warning about unsigned vs signed const char pointers in
openssl.
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | ex.c | 4 | ||||
-rw-r--r-- | gg.c | 4 | ||||
-rw-r--r-- | gmid.c | 4 | ||||
-rw-r--r-- | gmid.h | 4 | ||||
-rw-r--r-- | iri.c | 4 | ||||
-rw-r--r-- | log.c | 4 | ||||
-rw-r--r-- | mime.c | 4 | ||||
-rw-r--r-- | puny.c | 4 | ||||
-rw-r--r-- | server.c | 4 | ||||
-rw-r--r-- | utf8.c | 4 | ||||
-rw-r--r-- | utils.c | 9 |
12 files changed, 25 insertions, 26 deletions
@@ -296,8 +296,6 @@ cat <<__HEREDOC__ __HEREDOC__ -[ ${HAVE_VASPRINTF} -eq 0 ] && echo "#include <stdarg.h>" - [ ${HAVE_EXPLICIT_BZERO} -eq 0 -o \ ${HAVE_RECALLOCARRAY} -eq 0 -o \ ${HAVE_STRLCAT} -eq 0 -o \ @@ -14,6 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "gmid.h" + #include <err.h> #include <errno.h> @@ -24,8 +26,6 @@ #include <stdarg.h> #include <string.h> -#include "gmid.h" - int send_string(int fd, const char *str) { @@ -14,10 +14,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <string.h> - #include "gmid.h" +#include <string.h> + int flag2, flag3, bflag, cflag, hflag, Nflag, Vflag, vflag; const char *cert, *key; @@ -14,6 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "gmid.h" + #include <sys/stat.h> #include <errno.h> @@ -23,8 +25,6 @@ #include <signal.h> #include <string.h> -#include "gmid.h" - volatile sig_atomic_t hupped; struct vhost hosts[HOSTSLEN]; @@ -17,6 +17,8 @@ #ifndef GMID_H #define GMID_H +#include "config.h" + #include <sys/socket.h> #include <sys/types.h> @@ -33,8 +35,6 @@ #include <openssl/x509.h> -#include "config.h" - #define GEMINI_URL_LEN (1024+3) /* URL max len + \r\n + \0 */ #define SUCCESS 20 @@ -14,11 +14,11 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "gmid.h" + #include <ctype.h> #include <string.h> -#include "gmid.h" - static inline int unreserved(int p) { @@ -14,6 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "gmid.h" + #include <errno.h> #include <netdb.h> #include <stdarg.h> @@ -21,8 +23,6 @@ #include <string.h> #include <syslog.h> -#include "gmid.h" - void fatal(const char *fmt, ...) { @@ -14,12 +14,12 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "gmid.h" + #include <errno.h> #include <stdlib.h> #include <string.h> -#include "gmid.h" - void init_mime(struct mime *mime) { @@ -14,12 +14,12 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "gmid.h" + #include <stddef.h> #include <stdint.h> #include <string.h> -#include "gmid.h" - #define BASE 36 #define TMIN 1 #define TMAX 26 @@ -14,6 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "gmid.h" + #include <sys/stat.h> #include <netdb.h> @@ -26,8 +28,6 @@ #include <limits.h> #include <string.h> -#include "gmid.h" - struct server { struct client clients[MAX_USERS]; struct tls *ctx; @@ -21,11 +21,11 @@ * SOFTWARE. */ +#include "gmid.h" + #include <stddef.h> #include <stdint.h> -#include "gmid.h" - #define UTF8_ACCEPT 0 #define UTF8_REJECT 1 @@ -14,6 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "gmid.h" + #include <errno.h> #include <string.h> @@ -22,8 +24,6 @@ #include <openssl/x509_vfy.h> #include <openssl/x509v3.h> -#include "gmid.h" - static sigset_t set; void @@ -115,7 +115,7 @@ xstrdup(const char *s) } void -gen_certificate(const char *host, const char *certpath, const char *keypath) +gen_certificate(const char *hostname, const char *certpath, const char *keypath) { BIGNUM *e; EVP_PKEY *pkey; @@ -123,7 +123,8 @@ gen_certificate(const char *host, const char *certpath, const char *keypath) X509 *x509; X509_NAME *name; FILE *f; - const char *org = "gmid"; + const unsigned char *org = (const unsigned char*)"gmid"; + const unsigned char *host = (const unsigned char*)hostname; log_notice(NULL, "generating new certificate for %s (it could take a while)", |