Prechádzať zdrojové kódy

Merge branch 'maint'

* maint:
  Don't crash when a response is not defined
  Quiet a clang warning

Conflicts:
	src/crypto/bf_util.cc
	src/response.cc
Bryan Drewery 7 rokov pred
rodič
commit
94c8f16d77
2 zmenil súbory, kde vykonal 3 pridanie a 0 odobranie
  1. 1 0
      doc/UPDATES.md
  2. 2 0
      src/response.cc

+ 1 - 0
doc/UPDATES.md

@@ -22,6 +22,7 @@
   * Bots now share channel key to other bots even if not opped.
   * Fix rare issue with writing binary config.
   * Make ./wraith -q and -Q clearly exit when already written.
+  * Don't crash when looking up a missing response.
 
 # 1.4.9
   * Fix various compile warnings and spam

+ 2 - 0
src/response.cc

@@ -25,6 +25,8 @@ init_responses()
 const char *
 response(response_t type)
 {
+  if (!res_map.contains(type))
+    return type;
   return res_map[type][randint(res_map[type].size())];
 }
 /* vim: set sts=2 sw=2 ts=8 et: */