MeshCore/src/helpers/TxtDataHelpers.cpp

10 lines
209 B
C++
Raw Normal View History

2025-02-22 19:41:24 +11:00
#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
}