From: Matt Caswell Date: Thu, 30 Apr 2015 08:43:11 +0000 (+0100) Subject: Fix windows build X-Git-Tag: OpenSSL_1_1_0-pre1~1248 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a3ed492f58d1febb9e048fb6ab5b96983569bf3b;p=oweals%2Fopenssl.git Fix windows build The big apps cleanup broke the windows build. This commit fixes some miscellaneous issues so that it builds again. Reviewed-by: Andy Polyakov --- diff --git a/apps/apps.c b/apps/apps.c index a93151c831..ff832bd0be 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -1837,7 +1837,7 @@ X509_NAME *parse_name(const char *cp, long chtype, int canmulti) n = X509_NAME_new(); if (n == NULL) return NULL; - work = strdup(cp); + work = OPENSSL_strdup(cp); if (work == NULL) goto err; @@ -1894,12 +1894,12 @@ X509_NAME *parse_name(const char *cp, long chtype, int canmulti) goto err; } - free(work); + OPENSSL_free(work); return n; err: X509_NAME_free(n); - free(work); + OPENSSL_free(work); return NULL; } diff --git a/apps/opt.c b/apps/opt.c index df2bea5504..fbe4c4bebc 100644 --- a/apps/opt.c +++ b/apps/opt.c @@ -54,7 +54,7 @@ #if !defined(OPENSSL_SYS_MSDOS) # include OPENSSL_UNISTD #endif -#include + #include #include #include @@ -96,11 +96,11 @@ char *opt_progname(const char *argv0) /* Strip off trailing nonsense. */ n = strlen(p); if (n > 4 && - (strcmp(&p[n - 4], ".exe") == 0 || strcmp(&p[n - 4], ".EXE") == 0) + (strcmp(&p[n - 4], ".exe") == 0 || strcmp(&p[n - 4], ".EXE") == 0)) n -= 4; #if defined(OPENSSL_SYS_NETWARE) if (n > 4 && - (strcmp(&p[n - 4], ".nlm") == 0 || strcmp(&p[n - 4], ".NLM") == 0) + (strcmp(&p[n - 4], ".nlm") == 0 || strcmp(&p[n - 4], ".NLM") == 0)) n -= 4; #endif @@ -108,7 +108,7 @@ char *opt_progname(const char *argv0) if (n > sizeof prog - 1) n = sizeof prog - 1; for (q = prog, i = 0; i < n; i++, p++) - q++ = isupper(*p) ? tolower(*p) : *p; + *q++ = isupper(*p) ? tolower(*p) : *p; *q = '\0'; return prog; }