Skip to content

Commit 6dc21ad

Browse files
committed
Bug Fixes and Performance Improvements
1 parent 16b3a3f commit 6dc21ad

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/utils.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef UTILS_H
22
#define UTILS_H
33

4+
#include <iostream>
45
#include <cstdlib>
56
#include <string>
67
#include <cstring>
@@ -37,17 +38,17 @@ string getCurrentDate()
3738
struct tm tStruct;
3839
localtime_s(&tStruct, &t);
3940

40-
return std::to_string(tStruct.tm_mday) + "-" + std::to_string(tStruct.tm_mon + 1) + "-" + std::to_string(tStruct.tm_year + 1900);
41+
return to_string(tStruct.tm_mday) + "-" + to_string(tStruct.tm_mon + 1) + "-" + to_string(tStruct.tm_year + 1900);
4142
}
4243

43-
size_t strlcpy(char *dst, const char *src, size_t dstsize = std::numeric_limits<size_t>::max())
44+
size_t strlcpy(char *dst, const char *src, size_t dstsize = numeric_limits<size_t>::max())
4445
{
45-
size_t srclen = std::strlen(src);
46+
size_t srclen = strlen(src);
4647
size_t copylen = (srclen >= dstsize) ? dstsize - 1 : srclen;
4748

4849
if (dstsize != 0)
4950
{
50-
std::memcpy(dst, src, copylen);
51+
memcpy(dst, src, copylen);
5152
dst[copylen] = '\0'; // Null-terminate the destination buffer
5253
}
5354

0 commit comments

Comments
 (0)