summaryrefslogtreecommitdiff
path: root/src/color.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-05-13 14:23:07 +0200
committerMaxime Coste <frrrwww@gmail.com>2013-05-13 18:43:38 +0200
commit26f0fd4cc6577e52b08604d32469b221242bfb9c (patch)
treeb63d2936ac57352a0cb3a4a863cc735dacedaf1c /src/color.cc
parent56ab33c9d6dc0255bf15ebd1fbc216766ffb247c (diff)
Use more std::* for string handling
Diffstat (limited to 'src/color.cc')
-rw-r--r--src/color.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/color.cc b/src/color.cc
index 6067dcc5..7e8e9b01 100644
--- a/src/color.cc
+++ b/src/color.cc
@@ -2,8 +2,6 @@
#include "exception.hh"
-#include <stdlib.h>
-
namespace Kakoune
{
@@ -22,7 +20,7 @@ Color str_to_color(const String& color)
static const Regex rgb_regex{"rgb:[0-9a-fA-F]{6}"};
if (boost::regex_match(color, rgb_regex))
{
- long int l = strtol(color.c_str() + 4, NULL, 16);
+ long l = stol(color.substr(ByteCount{4}), NULL, 16);
return { (unsigned char)((l >> 16) & 0xFF),
(unsigned char)((l >> 8) & 0xFF),
(unsigned char)(l & 0xFF) };