From 72681d9d8a954bcb8dcf0e2071bfb6284bcff464 Mon Sep 17 00:00:00 2001 From: "pchen%netscape.com" Date: Fri, 2 Nov 2001 02:55:51 +0000 Subject: [PATCH] 81762, r=jag, sr=sfraser, remove uses of PL_strlen with testing for null and non-empty string git-svn-id: svn://10.0.0.236/trunk@107046 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpfe/appshell/src/nsCommandLineService.cpp | 4 ++-- mozilla/xpfe/components/startup/src/nsCommandLineService.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mozilla/xpfe/appshell/src/nsCommandLineService.cpp b/mozilla/xpfe/appshell/src/nsCommandLineService.cpp index 29e66812e66..84534c15608 100644 --- a/mozilla/xpfe/appshell/src/nsCommandLineService.cpp +++ b/mozilla/xpfe/appshell/src/nsCommandLineService.cpp @@ -185,13 +185,13 @@ PRBool nsCmdLineService::ArgsMatch(const char *lookingFor, const char *userGave) #if defined(XP_UNIX) || defined(XP_BEOS) /* on unix and beos, we'll allow --mail for -mail */ - if ((PL_strlen(lookingFor) > 0) && (PL_strlen(userGave) > 1)) { + if (lookingFor && userGave && (lookingFor[0] != '\0') && (userGave[0] != '\0') && (userGave[1] != '\0')) { if (!PL_strcasecmp(lookingFor+1,userGave+2) && (lookingFor[0] == '-') && (userGave[0] == '-') && (userGave[1] == '-')) return PR_TRUE; } #endif #ifdef XP_PC /* on windows /mail is the same as -mail */ - if ((PL_strlen(lookingFor) > 0) && (PL_strlen(userGave) > 0)) { + if (lookingFor && userGave && (lookingFor[0] != '\0') && (userGave[0] != '\0')) { if (!PL_strcasecmp(lookingFor+1,userGave+1) && (lookingFor[0] == '-') && (userGave[0] == '/')) return PR_TRUE; } #endif diff --git a/mozilla/xpfe/components/startup/src/nsCommandLineService.cpp b/mozilla/xpfe/components/startup/src/nsCommandLineService.cpp index 29e66812e66..84534c15608 100644 --- a/mozilla/xpfe/components/startup/src/nsCommandLineService.cpp +++ b/mozilla/xpfe/components/startup/src/nsCommandLineService.cpp @@ -185,13 +185,13 @@ PRBool nsCmdLineService::ArgsMatch(const char *lookingFor, const char *userGave) #if defined(XP_UNIX) || defined(XP_BEOS) /* on unix and beos, we'll allow --mail for -mail */ - if ((PL_strlen(lookingFor) > 0) && (PL_strlen(userGave) > 1)) { + if (lookingFor && userGave && (lookingFor[0] != '\0') && (userGave[0] != '\0') && (userGave[1] != '\0')) { if (!PL_strcasecmp(lookingFor+1,userGave+2) && (lookingFor[0] == '-') && (userGave[0] == '-') && (userGave[1] == '-')) return PR_TRUE; } #endif #ifdef XP_PC /* on windows /mail is the same as -mail */ - if ((PL_strlen(lookingFor) > 0) && (PL_strlen(userGave) > 0)) { + if (lookingFor && userGave && (lookingFor[0] != '\0') && (userGave[0] != '\0')) { if (!PL_strcasecmp(lookingFor+1,userGave+1) && (lookingFor[0] == '-') && (userGave[0] == '/')) return PR_TRUE; } #endif