mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-08-21 08:03:42 +08:00
LGTM fixes (#1480)
This commit is contained in:
@@ -30,13 +30,13 @@
|
||||
using namespace ublox;
|
||||
extern volatile sig_atomic_t do_exit;
|
||||
|
||||
void write_file(std::string fpath, uint8_t *data, int len) {
|
||||
void write_file(std::string fpath, uint8_t *to_write, int len) {
|
||||
FILE* f = fopen(fpath.c_str(), "wb");
|
||||
if (!f) {
|
||||
std::cout << "Open " << fpath << " failed" << std::endl;
|
||||
return;
|
||||
}
|
||||
fwrite(data, len, 1, f);
|
||||
fwrite(to_write, len, 1, f);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
@@ -72,11 +72,11 @@ Message * poll_ubloxraw_msg(Poller * poller) {
|
||||
}
|
||||
}
|
||||
|
||||
int send_gps_event(PubSocket *s, const void *buf, size_t len) {
|
||||
int send_gps_event(PubSocket *s, const void *buf, size_t length) {
|
||||
assert(s);
|
||||
write_file(prefix + "/" + std::to_string(save_idx), (uint8_t *)buf, len);
|
||||
write_file(prefix + "/" + std::to_string(save_idx), (uint8_t *)buf, length);
|
||||
save_idx++;
|
||||
return len;
|
||||
return length;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
Reference in New Issue
Block a user