util/StringStrip: use std::strlen()
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009-2018 Max Kellermann <max.kellermann@gmail.com>
|
* Copyright 2009-2020 Max Kellermann <max.kellermann@gmail.com>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
#include "StringStrip.hxx"
|
#include "StringStrip.hxx"
|
||||||
#include "CharUtil.hxx"
|
#include "CharUtil.hxx"
|
||||||
|
|
||||||
#include <string.h>
|
#include <cstring>
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
StripLeft(const char *p) noexcept
|
StripLeft(const char *p) noexcept
|
||||||
@@ -71,7 +71,7 @@ StripRight(const char *p, std::size_t length) noexcept
|
|||||||
void
|
void
|
||||||
StripRight(char *p) noexcept
|
StripRight(char *p) noexcept
|
||||||
{
|
{
|
||||||
std::size_t old_length = strlen(p);
|
std::size_t old_length = std::strlen(p);
|
||||||
std::size_t new_length = StripRight(p, old_length);
|
std::size_t new_length = StripRight(p, old_length);
|
||||||
p[new_length] = 0;
|
p[new_length] = 0;
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009-2018 Max Kellermann <max.kellermann@gmail.com>
|
* Copyright 2009-2020 Max Kellermann <max.kellermann@gmail.com>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
|
Reference in New Issue
Block a user