From 2e3f4b8c3d9e0b66e09147d7a259f55d9b200ed0 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 25 Apr 2018 22:26:20 +0200 Subject: [PATCH] test/test_cors.cc: use empty() over length() for emptiness check Fix for: [src/test/test_cors.cc:117]: (style) Checking if unsigned variable 'host.length()' is less than zero. [src/test/test_cors.cc:118]: (style) Checking if unsigned variable 'creds.length()' is less than zero. Signed-off-by: Danny Al-Gaaf --- src/test/test_cors.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/test/test_cors.cc b/src/test/test_cors.cc index 79490e30d4a..d9c6e579663 100644 --- a/src/test/test_cors.cc +++ b/src/test/test_cors.cc @@ -114,8 +114,7 @@ int test_cors_helper::extract_input(unsigned argc, char *argv[]){ ERR_CHECK_NEXT_PARAM(port); }else return -1; } - if(host.length() <= 0 || - creds.length() <= 0) + if(host.empty() || creds.empty()) return -1; return 0; } -- 2.39.5