Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hishizuka committed Oct 2, 2023
1 parent 368d888 commit 5e131e0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/logger/cython/logger_fit_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

void set_config_c(const config& _cfg) {
cfg.G_UNIT_ID_HEX = _cfg.G_UNIT_ID_HEX;
cfg.G_LOG_DIR = (char *)malloc(sizeof(char) * strlen(_cfg.G_LOG_DIR)+1);
strncpy(cfg.G_LOG_DIR, _cfg.G_LOG_DIR, strlen(_cfg.G_LOG_DIR));
cfg.G_LOG_DIR[strlen(_cfg.G_LOG_DIR)] = '\0';
cfg.G_LOG_DIR = strdup(_cfg.G_LOG_DIR);
}

char* get_upload_file_name_c() {
Expand Down Expand Up @@ -633,7 +631,7 @@ bool write_log_c(const char* db_file) {
_data = {(unsigned int)crc16(file_header)};
_size = {2};
add_fit_data(header_crc, _data, _size);

FILE *fp;
if((fp=fopen(filename,"w")) != NULL ) {
fwrite(file_header.data(), sizeof(uint8_t), file_header.size(), fp);
Expand Down

0 comments on commit 5e131e0

Please sign in to comment.