]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Work around false positive clang-tidy warning about redundant .c_str()
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 27 Apr 2020 15:01:57 +0000 (17:01 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 27 Apr 2020 15:01:57 +0000 (17:01 +0200)
src/Args.cpp

index 7d007f715b447a4df5df780fc840fbddb67da991..dd4b356d9b1b44f76a4ae334cff525716d674b75 100644 (file)
@@ -109,7 +109,7 @@ Args::from_gcc_atfile(const std::string& filename)
       // End of token
       *argpos = '\0';
       if (argbuf[0] != '\0') {
-        args_add(args, argbuf.c_str());
+        args.push_back(argbuf.substr(0, argbuf.find_last_not_of('\0') + 1));
       }
       argpos = argbuf.begin();
       if (*pos == '\0') {