Use QUOTEDSTRLEN macro instead of sizeof or strlen

This commit is contained in:
Rangi42
2024-03-27 11:50:48 -04:00
parent 912a1504ec
commit dcb4e40388
5 changed files with 16 additions and 11 deletions

View File

@@ -10,7 +10,7 @@
#include "error.hpp"
#include "extern/getopt.hpp"
#include "helpers.hpp" // Defer
#include "helpers.hpp"
#include "parser.hpp"
#include "version.hpp"
@@ -45,7 +45,7 @@ static std::string make_escape(std::string &str) {
break;
escaped.append(str, pos, nextPos - pos);
escaped.append("$$");
pos = nextPos + sizeof("$") - 1;
pos = nextPos + QUOTEDSTRLEN("$");
}
escaped.append(str, pos, str.length() - pos);
return escaped;