Преглед изворни кода

* Fix flaw in compat code

svn: 3386
Bryan Drewery пре 19 година
родитељ
комит
bac6894a21
2 измењених фајлова са 2 додато и 2 уклоњено
  1. 1 1
      src/mod/share.mod/share.c
  2. 1 1
      src/userrec.c

+ 1 - 1
src/mod/share.mod/share.c

@@ -1162,7 +1162,7 @@ write_tmp_userfile(char *fn, const struct userrec *bu, int idx)
 /* FIXME: REMOVE AFTER 1.2.14 */
     bool old = 0;
 
-    tand_t* bot = findbot(dcc[idx].nick);
+    tand_t* bot = idx != -1 ? findbot(dcc[idx].nick) : NULL;
     if (bot && bot->buildts < 1175102242) /* flood-* hacks */
       old = 1;
 

+ 1 - 1
src/userrec.c

@@ -480,7 +480,7 @@ int write_userfile(int idx)
 /* FIXME: REMOVE AFTER 1.2.14 */
   bool old = 0;
 
-  tand_t* bot = findbot(dcc[idx].nick);
+  tand_t* bot = idx != -1 ? findbot(dcc[idx].nick) : NULL;
   if (bot && bot->buildts < 1175102242) /* flood-* hacks */
     old = 1;
   channels_writeuserfile(old);