diff options
author | Rosen Penev <rosenp@gmail.com> | 2020-05-10 18:25:47 -0700 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2020-05-11 09:21:29 +0200 |
commit | bbdc0269bf49aa8dd8259d0c31efff2366f6647f (patch) | |
tree | 516c2ef42233cb6b5c71a8100a4ae71f87cf6fd8 /utils/libcecutil/cec-parse.cpp | |
parent | c39488120a52f88b730c406e2c6abf3176f5d06f (diff) |
utils: replace chr functions with std variants
*chr in std offers const overloads, which avoid conversions.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'utils/libcecutil/cec-parse.cpp')
-rw-r--r-- | utils/libcecutil/cec-parse.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/libcecutil/cec-parse.cpp b/utils/libcecutil/cec-parse.cpp index 5fffcce7..8c869fec 100644 --- a/utils/libcecutil/cec-parse.cpp +++ b/utils/libcecutil/cec-parse.cpp @@ -6,7 +6,6 @@ #include <unistd.h> #include <stdlib.h> #include <stdio.h> -#include <string.h> #include <inttypes.h> #include <getopt.h> #include <sys/types.h> @@ -18,6 +17,7 @@ #include <errno.h> #include <sys/ioctl.h> #include <stdarg.h> +#include <cstring> #include <ctime> #include <cerrno> #include <string> @@ -191,7 +191,7 @@ unsigned cec_parse_phys_addr(const char *value) { unsigned p1, p2, p3, p4; - if (!strchr(value, '.')) + if (!std::strchr(value, '.')) return strtoul(value, NULL, 0); if (sscanf(value, "%x.%x.%x.%x", &p1, &p2, &p3, &p4) != 4) { fprintf(stderr, "Expected a physical address of the form x.x.x.x\n"); |