diff --git a/linux/GPUMeter.c b/linux/GPUMeter.c index a3e2dd906..b73fb4dee 100644 --- a/linux/GPUMeter.c +++ b/linux/GPUMeter.c @@ -57,13 +57,12 @@ static int humanTimeUnit(char* buffer, size_t size, unsigned long long totalNano unsigned long long totalSeconds = value / 10000; if (totalSeconds < 60) { int width = 4; - unsigned int seconds = (unsigned int)(value / 10000); unsigned int fraction = (unsigned int)(value % 10000); - for (unsigned int limit = 1; seconds >= limit; limit *= 10) { + for (unsigned int limit = 1; (unsigned int)totalSeconds >= limit; limit *= 10) { width--; fraction /= 10; } - return xSnprintf(buffer, size, "%.u.%0*us", seconds, width, fraction); + return xSnprintf(buffer, size, "%.u.%0*us", (unsigned int)totalSeconds, width, fraction); } value = totalSeconds;