projects
/
infodrom
/
dtaus
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1b5c33a
)
Jens Rohler: prevent negative numbers
author
Joey Schulze
<joey@infodrom.org>
Fri, 26 Aug 2005 05:12:34 +0000
(
05:12
+0000)
committer
Joey Schulze
<joey@infodrom.org>
Fri, 26 Aug 2005 05:12:34 +0000
(
05:12
+0000)
bigint.c
patch
|
blob
|
history
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;