faster way to check for sign
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@283 59561ff5-6e30-0410-9f3c-9617f08c8826
diff --git a/tests/50-constraint-OK.asn1.-P b/tests/50-constraint-OK.asn1.-P
index 591ce0f..27c013b 100644
--- a/tests/50-constraint-OK.asn1.-P
+++ b/tests/50-constraint-OK.asn1.-P
@@ -133,12 +133,8 @@
return -1;
}
- if(asn1_INTEGER2long(st, &value)) {
- _ASN_ERRLOG(app_errlog, app_key,
- "%s: value too large (%s:%d)",
- td->name, __FILE__, __LINE__);
- return -1;
- }
+ /* Check if the sign bit is present */
+ value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0;
if((value >= 0)) {
/* Constraint check succeeded */