Pārlūkot izejas kodu

Replace strn with safer strl

tags/v1.2.0
Bertrand Lemasle pirms 7 gadiem
vecāks
revīzija
92637646ff
2 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. +2
    -2
      GpsTracker/Debug.cpp
  2. +1
    -1
      GpsTracker/Positions.cpp

+ 2
- 2
GpsTracker/Debug.cpp Parādīt failu

@@ -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 Parādīt failu

@@ -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();


Notiek ielāde…
Atcelt
Saglabāt