Skip to content

Commit

Permalink
Fix strcmp in config parser, now failover parameter should be set cor…
Browse files Browse the repository at this point in the history
…rectly
  • Loading branch information
Cédric Villemain authored and Jaime Casanova committed Mar 9, 2011
1 parent 0b69069 commit c6f0722
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config.c
Expand Up @@ -77,10 +77,10 @@ parse_config(const char* config_file, t_configuration_options* options)
char failoverstr[MAXLEN];
strncpy(failoverstr, value, MAXLEN);

if (strcmp(failoverstr, "manual"))
options->failover = MANUAL_FAILOVER;
else if (strcmp(failoverstr, "automatic"))
options->failover = AUTOMATIC_FAILOVER;
if (strcmp(failoverstr, "manual") == 0)
*failover = MANUAL_FAILOVER;
else if (strcmp(failoverstr, "automatic") == 0)
*failover = AUTOMATIC_FAILOVER;
else
{
printf ("WARNING: value for failover option is incorrect, it should be automatic or manual. Defaulting to manual.\n");
Expand Down

0 comments on commit c6f0722

Please sign in to comment.