]> granicus.if.org Git - fortune-mod/commitdiff
Silence compile-time or run-time warnings.
authorShlomi Fish <shlomif@shlomifish.org>
Wed, 29 Apr 2020 10:50:58 +0000 (13:50 +0300)
committerShlomi Fish <shlomif@shlomifish.org>
Wed, 29 Apr 2020 10:50:58 +0000 (13:50 +0300)
See:

* https://duckduckgo.com/?q=warnings+programming&atb=v140-1&ia=web

They are a distraction at best and may indicate other issues.

fortune-mod/fortune/fortune.c

index dcc668a65f83d71d8174f9c01e05bc12bc7d8784..ab7baeb91fc6226eeafc478040ceb24600633d77 100644 (file)
@@ -771,7 +771,7 @@ static int add_file(int percent, const char *file, const char *dir,
 
 static int names_compare(const void *a, const void *b)
 {
-    return strcmp(*(const char **)a, *(const char **)b);
+    return strcmp(*(const char *const *)a, *(const char *const *)b);
 }
 /*
  * add_dir: