mirror of
https://github.com/openssl/openssl.git
synced 2024-12-21 06:09:35 +08:00
7644a9aef8
Rename BUF_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} to OPENSSL_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} Add #define's for the old names. Add CRYPTO_{memdup,strndup}, called by OPENSSL_{memdup,strndup} macros. Reviewed-by: Tim Hudson <tjh@openssl.org>
58 lines
1.1 KiB
C
58 lines
1.1 KiB
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <ctype.h>
|
|
#include <openssl/crypto.h>
|
|
#include <openssl/e_os2.h>
|
|
#include <openssl/buffer.h>
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
char *p, *q = 0, *program;
|
|
|
|
p = strrchr(argv[0], '/');
|
|
if (!p)
|
|
p = strrchr(argv[0], '\\');
|
|
#ifdef OPENSSL_SYS_VMS
|
|
if (!p)
|
|
p = strrchr(argv[0], ']');
|
|
if (p)
|
|
q = strrchr(p, '>');
|
|
if (q)
|
|
p = q;
|
|
if (!p)
|
|
p = strrchr(argv[0], ':');
|
|
q = 0;
|
|
#endif
|
|
if (p)
|
|
p++;
|
|
if (!p)
|
|
p = argv[0];
|
|
if (p)
|
|
q = strchr(p, '.');
|
|
if (p && !q)
|
|
q = p + strlen(p);
|
|
|
|
if (!p)
|
|
program = OPENSSL_strdup("(unknown)");
|
|
else {
|
|
program = OPENSSL_malloc((q - p) + 1);
|
|
strncpy(program, p, q - p);
|
|
program[q - p] = '\0';
|
|
}
|
|
|
|
for (p = program; *p; p++)
|
|
if (islower((unsigned char)(*p)))
|
|
*p = toupper((unsigned char)(*p));
|
|
|
|
q = strstr(program, "TEST");
|
|
if (q > p && q[-1] == '_')
|
|
q--;
|
|
*q = '\0';
|
|
|
|
printf("No %s support\n", program);
|
|
|
|
OPENSSL_free(program);
|
|
return (0);
|
|
}
|