libluna: Run lint scripts
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
2f2b45758e
commit
37547ec640
@ -29,8 +29,8 @@ extern "C"
|
|||||||
[[deprecated]] char* strcpy(char* dst, const char* src);
|
[[deprecated]] char* strcpy(char* dst, const char* src);
|
||||||
[[deprecated]] char* strcat(char* dst, const char* src);
|
[[deprecated]] char* strcat(char* dst, const char* src);
|
||||||
|
|
||||||
char* strncpy(char* dest, const char* src, size_t max);
|
char* strncpy(char* dest, const char* src, usize max);
|
||||||
char* strncat(char* dest, const char* src, size_t max);
|
char* strncat(char* dest, const char* src, usize max);
|
||||||
|
|
||||||
char* strchr(const char* str, int c);
|
char* strchr(const char* str, int c);
|
||||||
char* strrchr(const char* str, int c);
|
char* strrchr(const char* str, int c);
|
||||||
|
@ -11,7 +11,7 @@ template <usize Size> class StaticString
|
|||||||
adopt(string);
|
adopt(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<usize OtherSize> StaticString(const StaticString<OtherSize>& other)
|
template <usize OtherSize> StaticString(const StaticString<OtherSize>& other)
|
||||||
{
|
{
|
||||||
adopt(other.chars());
|
adopt(other.chars());
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ extern "C"
|
|||||||
int strncmp(const char* a, const char* b, usize max)
|
int strncmp(const char* a, const char* b, usize max)
|
||||||
{
|
{
|
||||||
const char* s = a;
|
const char* s = a;
|
||||||
while (*a && (*a == *b) && (size_t)(a - s) < (max - 1))
|
while (*a && (*a == *b) && (usize)(a - s) < (max - 1))
|
||||||
{
|
{
|
||||||
a++;
|
a++;
|
||||||
b++;
|
b++;
|
||||||
@ -124,18 +124,18 @@ extern "C"
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* strncpy(char* dest, const char* src, size_t max)
|
char* strncpy(char* dest, const char* src, usize max)
|
||||||
{
|
{
|
||||||
size_t i;
|
usize i;
|
||||||
for (i = 0; i < max && src[i] != 0; i++) dest[i] = src[i];
|
for (i = 0; i < max && src[i] != 0; i++) dest[i] = src[i];
|
||||||
for (; i < max; i++) dest[i] = 0;
|
for (; i < max; i++) dest[i] = 0;
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* strncat(char* dest, const char* src, size_t max)
|
char* strncat(char* dest, const char* src, usize max)
|
||||||
{
|
{
|
||||||
size_t len = strlen(dest);
|
usize len = strlen(dest);
|
||||||
size_t i;
|
usize i;
|
||||||
|
|
||||||
for (i = 0; i < max && *(src + i); i++) *(dest + len + i) = *(src + i);
|
for (i = 0; i < max && *(src + i); i++) *(dest + len + i) = *(src + i);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user