forked from aniani/gmnisrv
config/routing: fix maybe-uninitialized errors
Trivial fix to silence compilation errors on gcc 9.3.0: src/config.c: In function ‘conf_ini_handler’: src/config.c:154:23: error: ‘routing’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 154 | enum gmnisrv_routing routing; | ^~~~~~~ src/config.c:197:18: error: ‘spec’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 197 | route->path = strdup(spec); | ^~~~~~~~~~~~ Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
parent
b45ddd813b
commit
d484ba0ab0
@ -166,6 +166,8 @@ conf_ini_handler(void *user, const char *section,
|
|||||||
routing = ROUTE_REGEX;
|
routing = ROUTE_REGEX;
|
||||||
spec = §ion[hostln + 1];
|
spec = §ion[hostln + 1];
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
assert(0);
|
||||||
}
|
}
|
||||||
assert(hostln < sizeof(hostname));
|
assert(hostln < sizeof(hostname));
|
||||||
strncpy(hostname, section, hostln);
|
strncpy(hostname, section, hostln);
|
||||||
|
Loading…
Reference in New Issue
Block a user