clang-3.7 warnings surfaced an actual bug:
invitation.c:185:5: error: address of array 'filename' will always evaluate to 'true'
[-Werror,-Wpointer-bool-conversion]
if(filename) {
~~ ^~~~~~~~
The regression was introduced in
3ccdf50beb6b2d3f2730bdc66006b43190537cde.
char *port = NULL;
char *hostport = NULL;
char *name = get_my_name(false);
- char filename[PATH_MAX];
+ char filename[PATH_MAX] = {0};
// Use first Address statement in own host config file
if(check_id(name)) {
hostname = xstrdup(line);
save:
- if(filename) {
+ if(*filename) {
FILE *f = fopen(filename, "a");
if(f) {
fprintf(f, "\nAddress = %s\n", hostname);