diff options
| author | David Sommerseth <dazo@eurephia.org> | 2014-12-05 15:54:20 +0100 |
|---|---|---|
| committer | David Sommerseth <dazo@eurephia.org> | 2014-12-05 15:54:20 +0100 |
| commit | 51f8c8e930221cc5feeac4f84be5550b4e5be9dd (patch) | |
| tree | 273723250b69b159a4207047d842b3352c553d64 /eurephiadm | |
| parent | 6308228c754e9ad0fb33aa8830d0a0bc46736b20 (diff) | |
| download | eurephia-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.c | 2 |
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); } |
