NPOS macro

This commit is contained in:
LuckyLaszlo
2022-08-12 18:16:49 +02:00
parent b44acafefe
commit c7bbf29a1b
9 changed files with 43 additions and 43 deletions

View File

@@ -157,7 +157,7 @@ void Webserv::_check_script_status(Client *client, std::string & output)
int status_pos;
pos = output.find("Status:");
if (pos != std::string::npos)
if (pos != NPOS)
{
status_pos = pos + std::string("Status:").size();
client->status = std::strtoul(output.c_str() + status_pos, NULL, 10);
@@ -179,13 +179,13 @@ void Webserv::_check_script_fields(Client *client, std::string & output)
// put server headers in map
tmp = client->response;
pos = tmp.find(CRLF CRLF);
if (pos != std::string::npos)
if (pos != NPOS)
tmp.erase(pos);
::parse_http_headers(tmp, srv_fld);
// put script headers in map
tmp = output;
pos = tmp.find(CRLF CRLF);
if (pos != std::string::npos)
if (pos != NPOS)
tmp.erase(pos);
::parse_http_headers(tmp, scr_fld);
// compare both map to supress duplicates