mirror of
https://github.com/revanced/smali.git
synced 2025-05-21 16:37:04 +02:00
Fix the printIntAsDec method in Indenting writer to correctly handle negative values
This commit is contained in:
parent
fadcc2dcb9
commit
f119fc6db5
@ -168,7 +168,11 @@ public class IndentingWriter extends Writer {
|
||||
|
||||
public void printIntAsDec(int value) throws IOException {
|
||||
int bufferIndex = 0;
|
||||
boolean negative = value < 0;
|
||||
|
||||
if (value < 0) {
|
||||
value *= -1;
|
||||
write('-');
|
||||
}
|
||||
|
||||
do {
|
||||
int digit = value % 10;
|
||||
@ -177,10 +181,6 @@ public class IndentingWriter extends Writer {
|
||||
value = value / 10;
|
||||
} while (value != 0);
|
||||
|
||||
if (negative) {
|
||||
write('-');
|
||||
}
|
||||
|
||||
while (bufferIndex>0) {
|
||||
write(buffer[--bufferIndex]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user