aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/rsa/BigInt.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-12-17 07:06:30 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2021-12-17 07:06:30 -0500
commit1fdc150116cad39aae5c5da407c3312b47a59e3a (patch)
tree123c79a4d7ad2d45781ba03ce939f7539fb428d8 /SQLiteStudio3/coreSQLiteStudio/rsa/BigInt.cpp
parentfeda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (diff)
New upstream version 3.3.3+dfsg1.upstream/3.3.3+dfsg1
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/rsa/BigInt.cpp')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/rsa/BigInt.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/rsa/BigInt.cpp b/SQLiteStudio3/coreSQLiteStudio/rsa/BigInt.cpp
index 0579add..3fbe83c 100644
--- a/SQLiteStudio3/coreSQLiteStudio/rsa/BigInt.cpp
+++ b/SQLiteStudio3/coreSQLiteStudio/rsa/BigInt.cpp
@@ -568,17 +568,18 @@ digitCount(rightNumber.digitCount), positive(rightNumber.positive)
//make sure we have just enough space
if (length <= digitCount + 2 || length > (digitCount << 2))
length = (unsigned long int) (digitCount * BigInt::FACTOR + 1);
- try
- {
- digits = new unsigned char[length];
- }
- catch (...)
- {
- delete[] digits;
- throw "Error BIGINT08: BigInt creation error (out of memory?).";
- }
- std::copy(rightNumber.digits, rightNumber.digits + digitCount, digits);
+ try
+ {
+ digits = new unsigned char[length];
+ }
+ catch (...)
+ {
+ delete[] digits;
+ throw "Error BIGINT08: BigInt creation error (out of memory?).";
+ }
+
+ std::copy(rightNumber.digits, rightNumber.digits + digitCount, digits);
}
BigInt::operator std::string() const
@@ -627,12 +628,13 @@ BigInt &BigInt::operator =(const BigInt &rightNumber)
std::ostream &operator <<(std::ostream &cout, const BigInt &number)
{
- if (!number.positive)
- cout << '-';
+ if (!number.positive)
+ cout << '-';
+
for (int i = number.digitCount - 1; i >= 0; i--)
cout << (int(number.digits[i]));
- return cout;
+ return cout;
}
std::istream &operator >>(std::istream &cin, BigInt &number)