diff options
| author | Alexander Barton <alex@barton.de> | 2011-11-03 09:54:28 +0100 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2011-11-03 09:54:28 +0100 |
| commit | d2f54abbedb299a8c3d32295c24397535a4bd2af (patch) | |
| tree | 25fcf746bf8ed19bd61595f24c1e0592ff796cfc | |
| parent | 07dbb73c929aa3f478abc51575c2dcafe6a62111 (diff) | |
| download | ngircd-d2f54abbedb299a8c3d32295c24397535a4bd2af.tar.gz ngircd-d2f54abbedb299a8c3d32295c24397535a4bd2af.zip | |
Clean up and fix comments of Check_ArgIsTrue()
Thanks to kaFux for pointing this out! And fix code formatting as well ...
| -rw-r--r-- | src/ngircd/conf.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c index 4991918d..97634af9 100644 --- a/src/ngircd/conf.c +++ b/src/ngircd/conf.c @@ -978,17 +978,21 @@ Read_Config( bool ngircd_starting ) } /** - * Check whether an string argument is true or false. + * Check whether a string argument is "true" or "false". * * @param Arg Input string. - * @returns true if string has been parsed as "yes"/"true"/"on". + * @returns true if the input string has been parsed as "yes", "true" + * (case insensitive) or a non-zero integer value. */ static bool -Check_ArgIsTrue( const char *Arg ) +Check_ArgIsTrue(const char *Arg) { - if( strcasecmp( Arg, "yes" ) == 0 ) return true; - if( strcasecmp( Arg, "true" ) == 0 ) return true; - if( atoi( Arg ) != 0 ) return true; + if (strcasecmp(Arg, "yes") == 0) + return true; + if (strcasecmp(Arg, "true") == 0) + return true; + if (atoi(Arg) != 0) + return true; return false; } |