소스 검색

Replace strn with safer strl

tags/v1.2.0
Bertrand Lemasle 7 년 전
부모
커밋
92637646ff
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. +2
    -2
      GpsTracker/Debug.cpp
  2. +1
    -1
      GpsTracker/Positions.cpp

+ 2
- 2
GpsTracker/Debug.cpp 파일 보기

@@ -142,7 +142,7 @@ namespace debug {
}

void setFakeGpsPosition() {
strncpy_P(gps::lastPosition, FAKE_GPS_ENTRY, GPS_POSITION_SIZE);
strlcpy_P(gps::lastPosition, FAKE_GPS_ENTRY, GPS_POSITION_SIZE);
Log.notice(F("Last position set to : %s\n"), gps::lastPosition);
}

@@ -191,6 +191,6 @@ namespace debug {
gps::getTime(time);
rtc::setTime(time);

Log.notice(F("OK"));
Log.notice(F("OK\n"));
}
}

+ 1
- 1
GpsTracker/Positions.cpp 파일 보기

@@ -42,7 +42,7 @@ namespace positions {
uint16_t entryAddress;
PositionEntry entry = { battery, gpsStatus };
strncpy(entry.position, gps::lastPosition, POSITION_SIZE);
strlcpy(entry.position, gps::lastPosition, POSITION_SIZE);

storage::powerOn();
config::read();


불러오는 중...
취소
저장