Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
bb20af8f
Commit
bb20af8f
authored
Oct 15, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/StringStrip: use std::strlen()
parent
9355ec44
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
StringStrip.cxx
src/util/StringStrip.cxx
+3
-3
StringStrip.hxx
src/util/StringStrip.hxx
+1
-1
No files found.
src/util/StringStrip.cxx
View file @
bb20af8f
/*
* Copyright 2009-20
18
Max Kellermann <max.kellermann@gmail.com>
* Copyright 2009-20
20
Max Kellermann <max.kellermann@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
...
...
@@ -30,7 +30,7 @@
#include "StringStrip.hxx"
#include "CharUtil.hxx"
#include <
string.h
>
#include <
cstring
>
const
char
*
StripLeft
(
const
char
*
p
)
noexcept
...
...
@@ -71,7 +71,7 @@ StripRight(const char *p, std::size_t length) noexcept
void
StripRight
(
char
*
p
)
noexcept
{
std
::
size_t
old_length
=
strlen
(
p
);
std
::
size_t
old_length
=
st
d
::
st
rlen
(
p
);
std
::
size_t
new_length
=
StripRight
(
p
,
old_length
);
p
[
new_length
]
=
0
;
}
...
...
src/util/StringStrip.hxx
View file @
bb20af8f
/*
* Copyright 2009-20
18
Max Kellermann <max.kellermann@gmail.com>
* Copyright 2009-20
20
Max Kellermann <max.kellermann@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
...
...
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