You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
397 B

3 months ago
  1. #include "tjcstrutils.hpp"
  2. namespace iflytop {
  3. const char* TJCStrUtils::cpystr(char* cpyto, const char* strbegin, int32_t maxlen) {
  4. if (strbegin == NULL) return NULL;
  5. if (*strbegin == 0xFF) return NULL;
  6. int32_t i = 0;
  7. for (i = 0; i < maxlen; i++) {
  8. cpyto[i] = strbegin[i];
  9. if (strbegin[i] == 0) {
  10. return &strbegin[i + 1];
  11. }
  12. }
  13. return NULL;
  14. }
  15. } // namespace iflytop