diff options
author | Bastian Koppelmann <kbastian@mail.uni-paderborn.de> | 2022-08-30 11:46:08 +0200 |
---|---|---|
committer | Bastian Koppelmann <kbastian@mail.uni-paderborn.de> | 2022-08-30 13:15:41 +0200 |
commit | c57bc8d8c3026ca069c3e7e54e0f29469d0312af (patch) | |
tree | de2bd08e180b7c4909ed34049434a47e122c45de | |
parent | 0338c1f696e01cd89c26ea7854cfc110c283f069 (diff) | |
download | navit-c57bc8d8c3026ca069c3e7e54e0f29469d0312af.tar.gz |
fix:navit: Fix -Waddress warning
since 'lastline[]' is stack-allocated it can never be NULL, thus we
don't need to check for that. This fixes the following compiler warning:
warning: the comparison will always evaluate as ‘true’ for the address of ‘lastline’ will never be NULL [-Waddress]
1809 | if ((lastline != NULL) && (strcmp(lastline, TEXTFILE_COMMENT_NAVI_STOPPED))) {
-rw-r--r-- | navit/navit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/navit/navit.c b/navit/navit.c index d3ef113f5..f01c9efcd 100644 --- a/navit/navit.c +++ b/navit/navit.c @@ -1806,7 +1806,7 @@ static int navit_former_destinations_active(struct navit *this_) { if (destination_file) { while(fgets(lastline, sizeof(lastline), destination_file)); fclose(destination_file); - if ((lastline != NULL) && (strcmp(lastline, TEXTFILE_COMMENT_NAVI_STOPPED))) { + if (strcmp(lastline, TEXTFILE_COMMENT_NAVI_STOPPED)) { active=1; } } |