1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Don't report memory usage if it's unknown

This commit is contained in:
Loren M. Lang 2013-04-22 18:13:31 -07:00
parent 7c87db3532
commit c35e57ab4e

View File

@ -1631,14 +1631,16 @@ public class Sketch {
System.out.println(I18n
.format(_("Binary sketch size: {0} bytes (of a {1} byte maximum) - {2}% used"),
textSize, maxTextSize, textSize * 100 / maxTextSize));
if(maxDataSize > 0) {
System.out.println(I18n
.format(_("Memory usage: {0} bytes (of a {1} byte maximum) - {2}% used"),
dataSize, maxDataSize, dataSize * 100 / maxDataSize));
} else {
System.out.println(I18n
.format(_("Memory usage: {0} bytes"),
dataSize));
if(dataSize >= 0) {
if(maxDataSize > 0) {
System.out.println(I18n
.format(_("Memory usage: {0} bytes (of a {1} byte maximum) - {2}% used"),
dataSize, maxDataSize, dataSize * 100 / maxDataSize));
} else {
System.out.println(I18n
.format(_("Memory usage: {0} bytes"),
dataSize));
}
}
} catch (RunnerException e) {
System.err.println(I18n.format(_("Couldn't determine program size: {0}"),