aboutsummaryrefslogtreecommitdiffstats
path: root/skeletons/INTEGER.c
diff options
context:
space:
mode:
authorvlm <vlm@59561ff5-6e30-0410-9f3c-9617f08c8826>2004-10-26 09:03:31 +0000
committervlm <vlm@59561ff5-6e30-0410-9f3c-9617f08c8826>2004-10-26 09:03:31 +0000
commit6c59384a0fe0fa0189af855b4a61b16cd211b31c (patch)
tree9a407dca3e29cb90f64b4b563485af0640f8b485 /skeletons/INTEGER.c
parent96a4e46725055414a92ce37e0e6e29fc20a8ea83 (diff)
alpha64
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@557 59561ff5-6e30-0410-9f3c-9617f08c8826
Diffstat (limited to 'skeletons/INTEGER.c')
-rw-r--r--skeletons/INTEGER.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/skeletons/INTEGER.c b/skeletons/INTEGER.c
index 740f3a75..db289cb2 100644
--- a/skeletons/INTEGER.c
+++ b/skeletons/INTEGER.c
@@ -379,24 +379,24 @@ asn_long2INTEGER(INTEGER_t *st, long value) {
* a) shall not all be ones; and
* b) shall not all be zero.
*/
- for(p = pstart; p < pend1; p += add) {
+ for(p = pstart; p != pend1; p += add) {
switch(*p) {
- case 0x00: if((p[1] & 0x80) == 0)
+ case 0x00: if((*(p+add) & 0x80) == 0)
continue;
break;
- case 0xff: if((p[1] & 0x80))
+ case 0xff: if((*(p+add) & 0x80))
continue;
break;
}
break;
}
/* Copy the integer body */
- for(pstart = p, bp = buf; p <= pend1;)
- *bp++ = *p++;
+ for(pstart = p, bp = buf, pend1 += add; p != pend1; p += add)
+ *bp++ = *p;
if(st->buf) FREEMEM(st->buf);
st->buf = buf;
- st->size = p - pstart;
+ st->size = bp - buf;
return 0;
}