From acd77f59d58d9ec812f64c833a5e029b9dbae92a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sun, 24 Sep 2023 01:27:09 +0200 Subject: [PATCH] MAYBE_DUPA needs to work around helpful toolchains that make string_view::operator[] actually be ::at() Closes: #134 --- src/include/libvoreutils.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/include/libvoreutils.hpp b/src/include/libvoreutils.hpp index 02fad8e..eaa7adc 100644 --- a/src/include/libvoreutils.hpp +++ b/src/include/libvoreutils.hpp @@ -361,10 +361,10 @@ namespace vore { #endif -#define MAYBE_DUPA(strv) \ - __extension__({ \ - auto && _strv = strv; \ - _strv[_strv.size()] ? strndupa(_strv.data(), _strv.size()) : _strv.data(); \ +#define MAYBE_DUPA(strv) \ + __extension__({ \ + auto && _strv = strv; \ + _strv.data()[_strv.size()] ? strndupa(_strv.data(), _strv.size()) : _strv.data(); \ })