summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-07-18 21:07:06 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-07-18 21:07:06 +0100
commit1702786389a71b28aac9c2f66dc27fa02889de22 (patch)
tree3c38f4f9a6a2aa22e5667a7f1de2c16476982413 /config.c
parent8f9a58e181d16cad2b86b8116bfe9470774bbdee (diff)
Fix compiler warnings emitted by Clang/LLVM and some older GCC versions.
Diffstat (limited to 'config.c')
-rw-r--r--config.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/config.c b/config.c
index 7f08e52..18e2178 100644
--- a/config.c
+++ b/config.c
@@ -22,7 +22,6 @@
// Returns 1 for success or 0 for error/failure.
int getconfstr(char *confname, char *filename, char* dest) {
FILE *fp;
- char *ret;
char str[MAXCHAR];
int found = 0; // Have we found the configuration option?
@@ -57,7 +56,7 @@ int getconfstr(char *confname, char *filename, char* dest) {
// If the resulting temporary string contains the requested option name,
// we have found our configuration option and it is in the current 'str'
- if (!(ret = strstr(substr, confname)) == 0) {
+ if (strstr(substr, confname)) {
found = 1;
break;
}
@@ -71,7 +70,7 @@ int getconfstr(char *confname, char *filename, char* dest) {
return 0;
}
- long int pos;
+ long int pos = 0;
char conf[MAXCHAR]; // Temporary string to build configuration value in
// Starting from the end of the option name, find the position of the start of the configuration value