Add support for shared libraries with OS/2.
[oweals/openssl.git] / crypto / asn1 / a_object.c
index 3873b98902e2abc0d3b310db9f9a2444e08ebe50..71ce7c3896c397b632cc5725229d4813e0ff6df4 100644 (file)
 int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
        {
        unsigned char *p;
+       int objsize;
 
        if ((a == NULL) || (a->data == NULL)) return(0);
 
-       if (pp == NULL)
-               return(ASN1_object_size(0,a->length,V_ASN1_OBJECT));
+       objsize = ASN1_object_size(0,a->length,V_ASN1_OBJECT);
+       if (pp == NULL) return objsize;
 
        p= *pp;
        ASN1_put_object(&p,0,a->length,V_ASN1_OBJECT,V_ASN1_UNIVERSAL);
@@ -77,7 +78,7 @@ int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
        p+=a->length;
 
        *pp=p;
-       return(a->length);
+       return(objsize);
        }
 
 int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
@@ -301,7 +302,7 @@ void ASN1_OBJECT_free(ASN1_OBJECT *a)
        }
 
 ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
-            char *sn, char *ln)
+            const char *sn, const char *ln)
        {
        ASN1_OBJECT o;