summaryrefslogtreecommitdiff
path: root/src/common/strlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/strlib.c')
-rw-r--r--src/common/strlib.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/common/strlib.c b/src/common/strlib.c
index 35e0c63b0..8b63b4161 100644
--- a/src/common/strlib.c
+++ b/src/common/strlib.c
@@ -62,11 +62,12 @@ char* jstrescapecpy (char* pt, const char* spt)
//a escape character is found, the target's final length increases! [Skotlex]
int i =0, j=0;
- if (!spt) { //Return an empty string [Skotlex]
+ if (!spt) {
+ //Return an empty string [Skotlex]
pt[0] = '\0';
return &pt[0];
}
-
+
while (spt[i] != '\0') {
switch (spt[i]) {
case '\'':
@@ -252,7 +253,8 @@ char* strtok_r_(char *s1, const char *s2, char **lasts) {
// for NetBSD 5.x and possibly some Solaris versions.
#if !(defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1400) && !defined(HAVE_STRNLEN)
/* Find the length of STRING, but scan at most MAXLEN characters.
- If no '\0' terminator is found in that many characters, return MAXLEN. */
+ * If no '\0' terminator is found in that many characters, return MAXLEN.
+ */
size_t strnlen(const char* string, size_t maxlen) {
const char* end = (const char*)memchr(string, '\0', maxlen);
return end ? (size_t) (end - string) : maxlen;
@@ -1136,13 +1138,13 @@ void strlib_defaults(void) {
strlib->trim = trim;
strlib->normalize_name = normalize_name;
strlib->stristr = stristr;
-
+
#if !(defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1400) && !defined(HAVE_STRNLEN)
strlib->strnlen = strnlen;
#else
strlib->strnlen = NULL;
#endif
-
+
#if defined(WIN32) && defined(_MSC_VER) && _MSC_VER <= 1200
strlib->strtoull = strtoull;
#else
@@ -1155,7 +1157,7 @@ void strlib_defaults(void) {
strlib->safesnprintf = safesnprintf;
strlib->strline = strline;
strlib->bin2hex = bin2hex;
-
+
StrBuf->Malloc = StringBuf_Malloc;
StrBuf->Init = StringBuf_Init;
StrBuf->Printf = StringBuf_Printf;
@@ -1167,7 +1169,7 @@ void strlib_defaults(void) {
StrBuf->Clear = StringBuf_Clear;
StrBuf->Destroy = StringBuf_Destroy;
StrBuf->Free = StringBuf_Free;
-
+
sv->parse_next = sv_parse_next;
sv->parse = sv_parse;
sv->split = sv_split;