systemcmds:Use inttypes

This commit is contained in:
David Sidrane
2021-06-16 17:07:47 +02:00
committed by Julian Oes
parent 62fd132047
commit 1b80018f30
7 changed files with 50 additions and 38 deletions
+4 -3
View File
@@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved.
* Copyright (c) 2012, 2013, 2021 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -41,6 +41,7 @@
#include <px4_platform_common/log.h>
#include <px4_platform_common/module.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -127,7 +128,7 @@ bl_update_main(int argc, char *argv[])
/* sanity-check file size */
if (s.st_size > BL_FILE_SIZE_LIMIT)
{
PX4_ERR("%s: file too large (limit: %u, actual: %d)", argv[1], BL_FILE_SIZE_LIMIT, s.st_size);
PX4_ERR("%s: file too large (limit: %u, actual: %jd)", argv[1], BL_FILE_SIZE_LIMIT, (intmax_t) s.st_size);
close(fd);
return 1;
}
@@ -145,7 +146,7 @@ bl_update_main(int argc, char *argv[])
if (buf == NULL)
{
PX4_ERR("failed to allocate %u bytes for firmware buffer", file_size);
PX4_ERR("failed to allocate %jd bytes for firmware buffer", (intmax_t) file_size);
close(fd);
return 1;
}