projects
/
infodrom
/
dtaus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Jens Rohler: prevent negative numbers
[infodrom/dtaus]
/
bigint.c
diff --git
a/bigint.c
b/bigint.c
index
889b7bd
..
61eefd4
100644
(file)
--- a/
bigint.c
+++ b/
bigint.c
@@
-98,6
+98,11
@@
bigint bigint_int(int num)
bigint x;
int i;
+ if (num < 0) {
+ fprintf(stderr, "Trying to assign negative value to bigint.\n");
+ num = 0;
+ }
+
for (i=0; i<BIGINT_LEN; i++) x.val[i] = 0L;
if (num < BIGINT_MAX)
x.val[0] = num;