Procházet zdrojové kódy

* Fix flaw in compat code

svn: 3386
Bryan Drewery před 19 roky
rodič
revize
bac6894a21
2 změnil soubory, kde provedl 2 přidání a 2 odebrání
  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 */
 /* FIXME: REMOVE AFTER 1.2.14 */
     bool old = 0;
     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 */
     if (bot && bot->buildts < 1175102242) /* flood-* hacks */
       old = 1;
       old = 1;
 
 

+ 1 - 1
src/userrec.c

@@ -480,7 +480,7 @@ int write_userfile(int idx)
 /* FIXME: REMOVE AFTER 1.2.14 */
 /* FIXME: REMOVE AFTER 1.2.14 */
   bool old = 0;
   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 */
   if (bot && bot->buildts < 1175102242) /* flood-* hacks */
     old = 1;
     old = 1;
   channels_writeuserfile(old);
   channels_writeuserfile(old);