mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-03-30 21:25:46 +00:00
* strncpy() refactor/fix
This commit is contained in:
9
src/helpers/TxtDataHelpers.cpp
Normal file
9
src/helpers/TxtDataHelpers.cpp
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "TxtDataHelpers.h"
|
||||
|
||||
void StrHelper::strncpy(char* dest, const char* src, size_t buf_sz) {
|
||||
while (buf_sz > 1 && *src) {
|
||||
*dest++ = *src++;
|
||||
buf_sz--;
|
||||
}
|
||||
*dest = 0; // truncates if needed
|
||||
}
|
||||
Reference in New Issue
Block a user