diff options
author | Ben Laurie <ben@openssl.org> | 2005-03-31 10:55:55 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2005-03-31 10:55:55 +0000 |
commit | 45d10efc354a407467112333714df2dad59c66d1 (patch) | |
tree | ae7b88d92ae682bff3f9eca70dbbb0c92b342fb4 /crypto/asn1/a_dup.c | |
parent | db3cb0e97a48720505e7fdd9781741d512446ef0 (diff) |
Simplicate and add lightness.
Diffstat (limited to 'crypto/asn1/a_dup.c')
-rw-r--r-- | crypto/asn1/a_dup.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crypto/asn1/a_dup.c b/crypto/asn1/a_dup.c index 8679263378..09f5f7ad89 100644 --- a/crypto/asn1/a_dup.c +++ b/crypto/asn1/a_dup.c @@ -62,23 +62,23 @@ #ifndef NO_OLD_ASN1 -void *ASN1_dup(int (*i2d)(char *,void *), - char *(*d2i)(void *,unsigned char **,long), char *x) +void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, char *x) { unsigned char *b,*p; - long i; + const unsigned char *p2; + int i; char *ret; if (x == NULL) return(NULL); - i=(long)i2d(x,NULL); - b=(unsigned char *)OPENSSL_malloc((unsigned int)i+10); + i=i2d(x,NULL); + b=OPENSSL_malloc(i+10); if (b == NULL) { ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); } p= b; i=i2d(x,&p); - p= b; - ret=d2i(NULL,&p,i); + p2= b; + ret=d2i(NULL,&p2,i); OPENSSL_free(b); return(ret); } |