aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorUlf Möller <ulf@openssl.org>2001-09-01 05:05:32 +0000
committerUlf Möller <ulf@openssl.org>2001-09-01 05:05:32 +0000
commitc078798c609eb12df615f1d07756d48bbcacf4ff (patch)
tree58b2f02e0c70b5439d8bd16139fbfc22889257d5 /crypto
parentde73cca9235b9dee94b0c9755368d21b61f5f27c (diff)
downloadopenssl-c078798c609eb12df615f1d07756d48bbcacf4ff.tar.gz
strsep implementation to allow the file to compile on non-BSD systems
Submitted by: "Brian Havard" <brianh@kheldar.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/evp/evp_test.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/crypto/evp/evp_test.c b/crypto/evp/evp_test.c
index 1fdc997619..87be695378 100644
--- a/crypto/evp/evp_test.c
+++ b/crypto/evp/evp_test.c
@@ -85,8 +85,39 @@ static int convert(unsigned char *s)
return s-d;
}
-static unsigned char *ustrsep(char **p,const char *sep)
- { return (unsigned char *)strsep((char **)p,sep); }
+static unsigned char *ustrsep(char **string ,const char *delim)
+ {
+ char isdelim[256];
+ char *token = *string;
+
+ if (**string == 0)
+ return NULL;
+
+ memset(isdelim, 0, 256);
+ isdelim[0] = 1;
+
+ while (*delim)
+ {
+ isdelim[(unsigned char)(*delim)] = 1;
+ delim++;
+ }
+
+ while (!isdelim[(unsigned char)(**string)])
+ {
+ while (!isdelim[(unsigned char)(**string)])
+ {
+ (*string)++;
+ }
+
+ if (**string)
+ {
+ **string = 0;
+ (*string)++;
+ }
+
+ return token;
+ }
+ }
static void test1(const EVP_CIPHER *c,const unsigned char *key,int kn,
const unsigned char *iv,int in,