Explorar o código

Merge branch 'master' into next

* master:
  Don't crash when a response is not defined
  Quiet a clang warning
  Tweak coverity more
  CXX doesn't expand here
Bryan Drewery %!s(int64=7) %!d(string=hai) anos
pai
achega
3ddc8c4251
Modificáronse 3 ficheiros con 5 adicións e 2 borrados
  1. 2 2
      .travis.yml
  2. 1 0
      doc/UPDATES.md
  3. 2 0
      src/response.cc

+ 2 - 2
.travis.yml

@@ -50,8 +50,8 @@ addons:
       name: "wraith/wraith"
       name: "wraith/wraith"
       description: "Build submitted via Travis CI"
       description: "Build submitted via Travis CI"
     notification_email: bryan-coverity@shatow.net
     notification_email: bryan-coverity@shatow.net
-    build_command_prepend: "cov-configure --comptype g++ --compiler ${CXX}; ./configure"
-    build_command: "make -j2"
+    build_command_prepend: "cov-configure --comptype g++ --compiler g++-6 --template; ./configure"
+    build_command: "make -j2 V=1"
     branch_pattern: coverity_scan
     branch_pattern: coverity_scan
 
 
 # State we need old build infrastructure for now
 # State we need old build infrastructure for now

+ 1 - 0
doc/UPDATES.md

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

+ 2 - 0
src/response.cc

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