summaryrefslogtreecommitdiff
path: root/beecrypt/mp.c
diff options
context:
space:
mode:
Diffstat (limited to 'beecrypt/mp.c')
-rw-r--r--beecrypt/mp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/beecrypt/mp.c b/beecrypt/mp.c
index 3e20b6f09..d19cc812d 100644
--- a/beecrypt/mp.c
+++ b/beecrypt/mp.c
@@ -1169,7 +1169,7 @@ mpw mppndiv(mpw xhi, mpw xlo, mpw y)
while (count--)
{
- if (carry | (xhi >= y))
+ if (((unsigned)carry) | (unsigned)(xhi >= y))
{
xhi -= y;
result |= 1;
@@ -1180,7 +1180,7 @@ mpw mppndiv(mpw xhi, mpw xlo, mpw y)
xlo <<= 1;
result <<= 1;
}
- if (carry | (xhi >= y))
+ if (((unsigned)carry) | (unsigned)(xhi >= y))
{
xhi -= y;
result |= 1;
@@ -1272,10 +1272,11 @@ void mpndivmod(mpw* result, size_t xsize, const mpw* xdata, size_t ysize, const
if (mpge(ysize, result+1, ydata))
{
(void) mpsub(ysize, result+1, ydata);
- *(result++) = 1;
+ *result = 1;
}
else
- *(result++) = 0;
+ *result = 0;
+ result++;
while (qsize--)
{