* new StrHelper::strzcpy()

This commit is contained in:
Scott Powell 2025-02-22 20:10:31 +11:00
parent 37f4ceff85
commit fc4e5ed54c
4 changed files with 13 additions and 3 deletions

View file

@ -332,7 +332,7 @@ class MyMesh : public BaseChatMesh {
out_frame[i++] = contact.flags;
out_frame[i++] = contact.out_path_len;
memcpy(&out_frame[i], contact.out_path, MAX_PATH_SIZE); i += MAX_PATH_SIZE;
memcpy(&out_frame[i], contact.name, 32); i += 32;
StrHelper::strzcpy((char *) &out_frame[i], contact.name, 32); i += 32;
memcpy(&out_frame[i], &contact.last_advert_timestamp, 4); i += 4;
memcpy(&out_frame[i], &contact.gps_lat, 4); i += 4;
memcpy(&out_frame[i], &contact.gps_lon, 4); i += 4;