Procházet zdrojové kódy

Replace strn with safer strl

tags/v1.2.0
Bertrand Lemasle před 7 roky
rodič
revize
92637646ff
2 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. +2
    -2
      GpsTracker/Debug.cpp
  2. +1
    -1
      GpsTracker/Positions.cpp

+ 2
- 2
GpsTracker/Debug.cpp Zobrazit soubor

@@ -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 Zobrazit soubor

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


Načítá se…
Zrušit
Uložit