Added preliminary Symbian support.
[silc.git] / lib / silcasn1 / silcasn1_decode.c
index 5fcfb4c7ec40e1e104969d81c31d8b8c241198b8..911515b2b88ae472c2ba7d5ac2d26cc4ad1e0d05 100644 (file)
@@ -310,7 +310,8 @@ silc_asn1_decoder(SilcAsn1 asn1, SilcStack stack1, SilcAsn1Tag type,
       }
     }
 
-    /* Short integer is actually big integer, so handle it correctly */
+    /* Short integer is actually big integer in the BER data, so handle
+       it correctly */
     if (type == SILC_ASN1_TAG_SHORT_INTEGER && type == tag)
       tag = SILC_ASN1_TAG_INTEGER;
 
@@ -527,7 +528,7 @@ silc_asn1_decoder(SilcAsn1 asn1, SilcStack stack1, SilcAsn1Tag type,
          /* Set two OID values */
          memset(&tmpb, 0, sizeof(tmpb));
          memset(tmpstr, 0, sizeof(tmpstr));
-         snprintf(tmpstr, sizeof(tmpstr) - 1, "%lu.%lu",
+         silc_snprintf(tmpstr, sizeof(tmpstr) - 1, "%lu.%lu",
                   (unsigned long)(rdata[0] & 0xff) / 40,
                   (unsigned long)(rdata[0] & 0xff) % 40);
          silc_buffer_sstrformat(asn1->stack1, &tmpb, tmpstr, SILC_STR_END);
@@ -549,7 +550,7 @@ silc_asn1_decoder(SilcAsn1 asn1, SilcStack stack1, SilcAsn1Tag type,
            oid |= rdata[i];
 
            memset(tmpstr, 0, sizeof(tmpstr));
-           snprintf(tmpstr, sizeof(tmpstr) - 1, ".%lu", (unsigned long)oid);
+           silc_snprintf(tmpstr, sizeof(tmpstr) - 1, ".%lu", (unsigned long)oid);
            silc_buffer_sstrformat(asn1->stack1, &tmpb, tmpstr, SILC_STR_END);
          }
          *oidstr = tmpb.head;
@@ -844,7 +845,6 @@ SilcBool silc_asn1_decode(SilcAsn1 asn1, SilcBuffer src, ...)
   SILC_ASN1_ARGS(asn1, type, tag, ber_class, opts);
   if (!type) {
     va_end(asn1->ap);
-    asn1->ap = NULL;
     return FALSE;
   }
 
@@ -917,7 +917,6 @@ SilcBool silc_asn1_decode(SilcAsn1 asn1, SilcBuffer src, ...)
   }
 
   va_end(asn1->ap);
-  asn1->ap = NULL;
 
   return ret;
 }