mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
DataFlash: fixed some build warnings
This commit is contained in:
parent
d8ca0658d7
commit
438f954379
@ -149,7 +149,9 @@ bool DataFlash_File::NeedErase(void)
|
||||
char *DataFlash_File::_log_file_name(uint16_t log_num)
|
||||
{
|
||||
char *buf = NULL;
|
||||
asprintf(&buf, "%s/%u.BIN", _log_directory, (unsigned)log_num);
|
||||
if (asprintf(&buf, "%s/%u.BIN", _log_directory, (unsigned)log_num) == 0) {
|
||||
return NULL;
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
@ -160,7 +162,9 @@ char *DataFlash_File::_log_file_name(uint16_t log_num)
|
||||
char *DataFlash_File::_lastlog_file_name(void)
|
||||
{
|
||||
char *buf = NULL;
|
||||
asprintf(&buf, "%s/LASTLOG.TXT", _log_directory);
|
||||
if (asprintf(&buf, "%s/LASTLOG.TXT", _log_directory) == 0) {
|
||||
return NULL;
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
||||
#include <assert.h>
|
||||
#include "DataFlash.h"
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wunused-result"
|
||||
|
||||
#define DF_PAGE_SIZE 512
|
||||
#define DF_NUM_PAGES 16384
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user