gcontini
2021-05-20 5251b3df104c0bb210c88bd935a7cc1fd41e4537
src/library/base/string_utils.cpp
@@ -107,4 +107,17 @@
   return count;
}
size_t mstrlcpy(char *dst, const char *src, size_t n) {
   size_t n_orig = n;
   if (n > 0) {
      char *pd;
      const char *ps;
      for (--n, pd = dst, ps = src; n > 0 && *ps != '\0'; --n, ++pd, ++ps) *pd = *ps;
      *pd = '\0';
   }
   return n_orig - n;
}
} /* namespace license */