diff --git a/configure b/configure index ff21509..6975a29 100755 --- a/configure +++ b/configure @@ -296,8 +296,6 @@ cat <<__HEREDOC__ __HEREDOC__ -[ ${HAVE_VASPRINTF} -eq 0 ] && echo "#include " - [ ${HAVE_EXPLICIT_BZERO} -eq 0 -o \ ${HAVE_RECALLOCARRAY} -eq 0 -o \ ${HAVE_STRLCAT} -eq 0 -o \ diff --git a/ex.c b/ex.c index 8d9f496..f1b4fa5 100644 --- a/ex.c +++ b/ex.c @@ -14,6 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "gmid.h" + #include #include @@ -24,8 +26,6 @@ #include #include -#include "gmid.h" - int send_string(int fd, const char *str) { diff --git a/gg.c b/gg.c index eb5098a..8a1e7eb 100644 --- a/gg.c +++ b/gg.c @@ -14,10 +14,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include - #include "gmid.h" +#include + int flag2, flag3, bflag, cflag, hflag, Nflag, Vflag, vflag; const char *cert, *key; diff --git a/gmid.c b/gmid.c index bcebfbc..b17fb4f 100644 --- a/gmid.c +++ b/gmid.c @@ -14,6 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "gmid.h" + #include #include @@ -23,8 +25,6 @@ #include #include -#include "gmid.h" - volatile sig_atomic_t hupped; struct vhost hosts[HOSTSLEN]; diff --git a/gmid.h b/gmid.h index a2e6be5..a8fd595 100644 --- a/gmid.h +++ b/gmid.h @@ -17,6 +17,8 @@ #ifndef GMID_H #define GMID_H +#include "config.h" + #include #include @@ -33,8 +35,6 @@ #include -#include "config.h" - #define GEMINI_URL_LEN (1024+3) /* URL max len + \r\n + \0 */ #define SUCCESS 20 diff --git a/iri.c b/iri.c index b911b0d..442af15 100644 --- a/iri.c +++ b/iri.c @@ -14,11 +14,11 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "gmid.h" + #include #include -#include "gmid.h" - static inline int unreserved(int p) { diff --git a/log.c b/log.c index 26bd988..7f2d555 100644 --- a/log.c +++ b/log.c @@ -14,6 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "gmid.h" + #include #include #include @@ -21,8 +23,6 @@ #include #include -#include "gmid.h" - void fatal(const char *fmt, ...) { diff --git a/mime.c b/mime.c index f8fdd67..7fb444d 100644 --- a/mime.c +++ b/mime.c @@ -14,12 +14,12 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "gmid.h" + #include #include #include -#include "gmid.h" - void init_mime(struct mime *mime) { diff --git a/puny.c b/puny.c index b28065c..7c3c92e 100644 --- a/puny.c +++ b/puny.c @@ -14,12 +14,12 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "gmid.h" + #include #include #include -#include "gmid.h" - #define BASE 36 #define TMIN 1 #define TMAX 26 diff --git a/server.c b/server.c index 777815e..a677ab5 100644 --- a/server.c +++ b/server.c @@ -14,6 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "gmid.h" + #include #include @@ -26,8 +28,6 @@ #include #include -#include "gmid.h" - struct server { struct client clients[MAX_USERS]; struct tls *ctx; diff --git a/utf8.c b/utf8.c index 20985b4..341da33 100644 --- a/utf8.c +++ b/utf8.c @@ -21,11 +21,11 @@ * SOFTWARE. */ +#include "gmid.h" + #include #include -#include "gmid.h" - #define UTF8_ACCEPT 0 #define UTF8_REJECT 1 diff --git a/utils.c b/utils.c index 9c88b83..e35357b 100644 --- a/utils.c +++ b/utils.c @@ -14,6 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "gmid.h" + #include #include @@ -22,8 +24,6 @@ #include #include -#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)",