diff --git a/GpsTracker/Debug.cpp b/GpsTracker/Debug.cpp index 3377cbc..7d277ea 100644 --- a/GpsTracker/Debug.cpp +++ b/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")); } } \ No newline at end of file diff --git a/GpsTracker/Positions.cpp b/GpsTracker/Positions.cpp index c6efc72..1ae7242 100644 --- a/GpsTracker/Positions.cpp +++ b/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();