From 043f1775872c8304c93c8e213e87d8a8f6c6dfec Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Jul 2011 15:09:03 +0200 Subject: Update tag to be ints instead of longs This is in order to circumvent a bug in enif_make_ulong in R14B03 for halfword --- lib/asn1/c_src/asn1_erl_nif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/asn1/c_src/asn1_erl_nif.c b/lib/asn1/c_src/asn1_erl_nif.c index a9bf98c44a..58314e23c2 100644 --- a/lib/asn1/c_src/asn1_erl_nif.c +++ b/lib/asn1/c_src/asn1_erl_nif.c @@ -898,7 +898,7 @@ int decode_tag(ErlNifEnv* env, ERL_NIF_TERM *tag, unsigned char *in_buf, /* then get the tag number */ if ((tmp_tag = (int) INVMASK(in_buf[*ib_index],ASN1_CLASSFORM)) < 31) { - *tag = enif_make_ulong(env, tag_no + tmp_tag); + *tag = enif_make_uint(env, tag_no + tmp_tag); (*ib_index)++; } else { int n = 0; /* n is used to check that the 64K limit is not @@ -924,7 +924,7 @@ int decode_tag(ErlNifEnv* env, ERL_NIF_TERM *tag, unsigned char *in_buf, return ASN1_TAG_ERROR; /* tag number > 64K */ tag_no = tag_no + in_buf[*ib_index]; (*ib_index)++; - *tag = enif_make_ulong(env, tag_no); + *tag = enif_make_uint(env, tag_no); } return form; } -- cgit v1.2.3