Move the definition of Win32_rename(), since the macro rename gets undefined
[openssl.git] / apps / asn1pars.c
index 88db0d197835255536554b7f3e35e844310e49a3..305db1590359068f9e7360cbcd43a21faf5d94b6 100644 (file)
@@ -94,6 +94,7 @@ int MAIN(int argc, char **argv)
        char *infile=NULL,*str=NULL,*prog,*oidfile=NULL, *derfile=NULL;
        char *genstr=NULL, *genconf=NULL;
        unsigned char *tmpbuf;
+       const unsigned char *ctmpbuf;
        BUF_MEM *buf=NULL;
        STACK *osk=NULL;
        ASN1_TYPE *at=NULL;
@@ -317,7 +318,8 @@ bad:
                        tmpbuf+=j;
                        tmplen-=j;
                        atmp = at;
-                       at = d2i_ASN1_TYPE(NULL,&tmpbuf,tmplen);
+                       ctmpbuf = tmpbuf;
+                       at = d2i_ASN1_TYPE(NULL,&ctmpbuf,tmplen);
                        ASN1_TYPE_free(atmp);
                        if(!at)
                                {
@@ -341,7 +343,7 @@ bad:
 
        num -= offset;
 
-       if ((length == 0) || (length > num)) length=(unsigned int)num;
+       if ((length == 0) || ((long)length > num)) length=(unsigned int)num;
        if(derout) {
                if(BIO_write(derout, str + offset, length) != (int)length) {
                        BIO_printf(bio_err, "Error writing output\n");