summaryrefslogtreecommitdiffstats
path: root/eurephiadm
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@eurephia.org>2014-12-05 15:54:20 +0100
committerDavid Sommerseth <dazo@eurephia.org>2014-12-05 15:54:20 +0100
commit51f8c8e930221cc5feeac4f84be5550b4e5be9dd (patch)
tree273723250b69b159a4207047d842b3352c553d64 /eurephiadm
parent6308228c754e9ad0fb33aa8830d0a0bc46736b20 (diff)
downloadeurephia-51f8c8e930221cc5feeac4f84be5550b4e5be9dd.tar.gz
eurephia-51f8c8e930221cc5feeac4f84be5550b4e5be9dd.tar.xz
eurephia-51f8c8e930221cc5feeac4f84be5550b4e5be9dd.zip
Correct ugly boundary checks in database init
The check if dbargc exceeds MAX_ARGUMENTS was done _after_ it was checked if the array element is NULL. This was not the intention. Signed-off-by: David Sommerseth <dazo@eurephia.org>
Diffstat (limited to 'eurephiadm')
-rw-r--r--eurephiadm/eurephiadm.c2
1 files changed, 1 insertions, 1 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);
}