Skip to content

Commit

Permalink
[batterytracker] Fix logging format strings. JB#41302
Browse files Browse the repository at this point in the history
Loop counter was changed from int to size_t type, but format strings
were not updated accordingly - which makes aarch64 builds fail.

Update format string to match passed arguments.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Apr 10, 2018
1 parent f04b083 commit e0b37b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/batterytracker.c
Expand Up @@ -771,7 +771,7 @@ static void config_load(void)
/* Must define at least "min_level" and "polling time".
*/
if( values < 2 ) {
dsme_log(LOG_ERR, PFIX"%s:%d: %s: not enough data",
dsme_log(LOG_ERR, PFIX"%s:%zd: %s: not enough data",
BATTERY_LEVEL_CONFIG_FILE, i+1,
config_level_name[i]);
goto EXIT;
Expand All @@ -792,23 +792,23 @@ static void config_load(void)
* Polling times should also make sense 10-1000s
*/
if( temp[i].polling_time < 10 || temp[i].polling_time > 1000 ) {
dsme_log(LOG_ERR, PFIX"%s:%d: %s: invalid polling_time=%d",
dsme_log(LOG_ERR, PFIX"%s:%zd: %s: invalid polling_time=%d",
BATTERY_LEVEL_CONFIG_FILE, i+1,
config_level_name[i],
temp[i].polling_time);
goto EXIT;
}

if( temp[i].min_level < 0 || temp[i].min_level > 100 ) {
dsme_log(LOG_ERR, PFIX"%s:%d: %s: invalid min_level=%d",
dsme_log(LOG_ERR, PFIX"%s:%zd: %s: invalid min_level=%d",
BATTERY_LEVEL_CONFIG_FILE, i+1,
config_level_name[i],
temp[i].min_level);
goto EXIT;
}

if( (i > 0) && temp[i-1].min_level <= temp[i].min_level ) {
dsme_log(LOG_ERR, PFIX"%s:%d: %s: min_level=%d is not descending",
dsme_log(LOG_ERR, PFIX"%s:%zd: %s: min_level=%d is not descending",
BATTERY_LEVEL_CONFIG_FILE, i+1,
config_level_name[i],
temp[i].min_level);
Expand Down

0 comments on commit e0b37b0

Please sign in to comment.