Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
mongoose
Commits
69e2b298
Commit
69e2b298
authored
Jan 16, 2019
by
Deomid Ryabkov
Committed by
Cesanta Bot
Jan 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add mg_strfree()
CL: Add mg_strfree() PUBLISHED_FROM=b80566218986e0607a9d2758bf776a1031b27212
parent
c431904b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
mongoose.c
mongoose.c
+8
-0
mongoose.h
mongoose.h
+5
-0
No files found.
mongoose.c
View file @
69e2b298
...
...
@@ -1774,6 +1774,14 @@ int mg_strncmp(const struct mg_str str1, const struct mg_str str2, size_t n) {
return
mg_strcmp
(
s1
,
s2
);
}
void
mg_strfree
(
struct
mg_str
*
s
)
WEAK
;
void
mg_strfree
(
struct
mg_str
*
s
)
{
char
*
sp
=
(
char
*
)
s
->
p
;
s
->
p
=
NULL
;
s
->
len
=
0
;
if
(
sp
!=
NULL
)
free
(
sp
);
}
const
char
*
mg_strstr
(
const
struct
mg_str
haystack
,
const
struct
mg_str
needle
)
WEAK
;
const
char
*
mg_strstr
(
const
struct
mg_str
haystack
,
...
...
mongoose.h
View file @
69e2b298
...
...
@@ -2280,6 +2280,11 @@ int mg_strcmp(const struct mg_str str1, const struct mg_str str2);
*/
int
mg_strncmp
(
const
struct
mg_str
str1
,
const
struct
mg_str
str2
,
size_t
n
);
/*
* Free the string (assuming it was heap allocated).
*/
void
mg_strfree
(
struct
mg_str
*
s
);
/*
* Finds the first occurrence of a substring `needle` in the `haystack`.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment