From 124a9cb030c52819996c70b98e9025461208a1dd Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sun, 11 Feb 2018 06:07:43 -0500 Subject: [PATCH] correction --- libi2pd/HTTP.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libi2pd/HTTP.cpp b/libi2pd/HTTP.cpp index 9bca11d7..49e70ddc 100644 --- a/libi2pd/HTTP.cpp +++ b/libi2pd/HTTP.cpp @@ -84,11 +84,11 @@ namespace http { pos_c = url.find('@', pos_p); /* find end of 'user' or 'user:pass' part */ if (pos_c != std::string::npos && (pos_s == std::string::npos || pos_s > pos_c)) { std::size_t delim = url.find(':', pos_p); - if (delim && delim != std::string::npos && delim < pos_c) { + if (delim != std::string::npos && delim < pos_c) { user = url.substr(pos_p, delim - pos_p); delim += 1; pass = url.substr(delim, pos_c - delim); - } else { + } else if(delim) { user = url.substr(pos_p, pos_c - pos_p); } pos_p = pos_c + 1;