mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 06:53:34 +08:00
systemcmds:Use inttypes
This commit is contained in:
committed by
Julian Oes
parent
62fd132047
commit
1b80018f30
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user