summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eurephiadm/eurephiadm.c2
-rw-r--r--plugin/eurephia.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/eurephiadm/eurephiadm.c b/eurephiadm/eurephiadm.c
index 6775a4f..f9deb31 100644
--- a/eurephiadm/eurephiadm.c
+++ b/eurephiadm/eurephiadm.c
@@ -250,7 +250,7 @@ int eurephia_ConnectDB(eurephiaCTX *ctx, const char *argstr) {
dbargc = 0;
dbargv[dbargc] = strtok(cp, delims);
- while( (dbargv[dbargc] != NULL) && (dbargc <= MAX_ARGUMENTS) ) {
+ while( (dbargc <= MAX_ARGUMENTS) && (dbargv[dbargc] != NULL) ) {
dbargv[++dbargc] = strtok(NULL, delims);
}
diff --git a/plugin/eurephia.c b/plugin/eurephia.c
index 880ad71..25af617 100644
--- a/plugin/eurephia.c
+++ b/plugin/eurephia.c
@@ -115,7 +115,7 @@ eurephiaCTX *eurephiaInit(const char const **argv, const char const **envp)
// Put the rest of the arguments into an own array which will be the db module arguments
if( optind < argc ) {
// copy arguments, but make sure we do not exceed our limit
- while( (optind < argc) && (dbargc < MAX_ARGUMENTS) ) {
+ while( (dbargc < MAX_ARGUMENTS) && (optind < argc) ) {
dbargv[dbargc] = argv[optind++];
dbargc++;
dbargv[dbargc] = NULL;