(rr13): handle zero length bit strings

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6880 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1999-08-27 09:03:41 +00:00
parent 92c4c345c6
commit 5196926ac0

View File

@@ -40,6 +40,9 @@ rr13(unsigned char *buf, size_t len)
unsigned char *tmp;
int bytes = (len + 7) / 8;
int i;
if(len == 0)
return;
{
const int bits = 13 % len;
const int lbit = len % 8;
@@ -71,6 +74,7 @@ rr13(unsigned char *buf, size_t len)
buf[i] = (tmp[b1] << s1) | (tmp[b2] >> s2);
}
free(tmp);
}
}
/* Add `b' to `a', both beeing one's complement numbers. */