Przeglądaj źródła

* Fixup some possible crashes

Bryan Drewery 17 lat temu
rodzic
commit
92e7108baf
2 zmienionych plików z 2 dodań i 2 usunięć
  1. 0 1
      src/chanprog.c
  2. 2 1
      src/cmds.c

+ 0 - 1
src/chanprog.c

@@ -873,7 +873,6 @@ samechans(const char *nick, const char *delim)
       strlcat(ret, delim, sizeof(ret));
     }
   }
-  ret[strlen(ret) - 1] = 0;
 
   return ret;
 }

+ 2 - 1
src/cmds.c

@@ -580,6 +580,8 @@ static void cmd_nohelp(int idx, char *par)
   bind_entry_t *entry = NULL;
   bind_table_t *table = bind_table_lookup("dcc");
 
+  buf[0] = 0;
+
   for (entry = table->entries; entry; entry = entry->next) {
     if (findhelp(entry->mask) == NULL) {
       siz = strlen(buf) + 2 + strlen(entry->mask) + 1;
@@ -588,7 +590,6 @@ static void cmd_nohelp(int idx, char *par)
       strlcat(buf, ", ", siz);
     }
   }
-  buf[strlen(buf) - 1] = 0;
 
   dumplots(idx, "", buf);
 }