[cvslog] Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Thu Oct 11 08:02:01 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2001-10-11 13:01:46 UTC
Commited by: Tothwolf <tothwolf at techmonkeys.org>

Modified files:
     src/dns.c src/eggdrop.h src/net.c src/mod/channels.mod/cmdschan.c
     src/mod/filesys.mod/dbcompat.c src/mod/filesys.mod/filedb3.c
     src/mod/filesys.mod/files.c src/mod/filesys.mod/filesys.c
     src/mod/filesys.mod/tclfiles.c src/mod/notes.mod/notes.c
     src/mod/transfer.mod/transfer.c

Log message:

* malloc_strcpy/realloc_strcpy bugfixes

---------------------- diff included ----------------------
Index: eggdrop1.7/src/dns.c
diff -u eggdrop1.7/src/dns.c:1.26 eggdrop1.7/src/dns.c:1.27
--- eggdrop1.7/src/dns.c:1.26	Thu Oct 11 06:34:19 2001
+++ eggdrop1.7/src/dns.c	Thu Oct 11 08:01:35 2001
@@ -4,7 +4,7 @@
  *   provides the code used by the bot if the DNS module is not loaded
  *   DNS Tcl commands
  *
- * $Id: dns.c,v 1.26 2001/10/11 11:34:19 tothwolf Exp $
+ * $Id: dns.c,v 1.27 2001/10/11 13:01:35 tothwolf Exp $
  */
 /*
  * Written by Fabian Knittel <fknittel at gmx.de>
@@ -528,7 +528,7 @@
 #ifdef IPV6
     struct sockaddr_in6 in6;
 #endif
-    char *origname = NULL;
+    char *origname;
 
     if (egg_inet_pton(AF_INET, ip, &in.sin_addr)) {
 debug1("|DNS| adns_dns_hostbyip(\"%s\") (IPv4)", ip);
@@ -579,7 +579,7 @@
 	call_ipbyhost(host, host, 1);
     } else {
 	char *p;
-	char *origname = NULL;
+	char *origname;
 	int type, r;
 	malloc_strcpy(origname, host);
 	if (!egg_strncasecmp("ipv6%", host, 5)) {
Index: eggdrop1.7/src/eggdrop.h
diff -u eggdrop1.7/src/eggdrop.h:1.44 eggdrop1.7/src/eggdrop.h:1.45
--- eggdrop1.7/src/eggdrop.h:1.44	Thu Oct 11 06:34:19 2001
+++ eggdrop1.7/src/eggdrop.h	Thu Oct 11 08:01:35 2001
@@ -4,7 +4,7 @@
  *
  *   IF YOU ALTER THIS FILE, YOU NEED TO RECOMPILE THE BOT.
  *
- * $Id: eggdrop.h,v 1.44 2001/10/11 11:34:19 tothwolf Exp $
+ * $Id: eggdrop.h,v 1.45 2001/10/11 13:01:35 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -168,11 +168,17 @@
     ptr = NULL;								\
   }
 
+#define malloc_strcpy(target, entry)					\
+do {									\
+  (target) = malloc(strlen(entry) + 1);					\
+  strcpy((target), (entry));						\
+} while (0)
+
 /* Copy entry to target -- Uses dynamic memory allocation, which
  * means you'll eventually have to free the memory again. 'target'
  * will be overwritten.
  */
-#define malloc_strcpy(target, entry)					\
+#define realloc_strcpy(target, entry)					\
 do {									\
   if (entry) {								\
     (target) = realloc((target), strlen(entry) + 1);			\
Index: eggdrop1.7/src/mod/channels.mod/cmdschan.c
diff -u eggdrop1.7/src/mod/channels.mod/cmdschan.c:1.53 eggdrop1.7/src/mod/channels.mod/cmdschan.c:1.54
--- eggdrop1.7/src/mod/channels.mod/cmdschan.c:1.53	Wed Oct 10 05:44:05 2001
+++ eggdrop1.7/src/mod/channels.mod/cmdschan.c	Thu Oct 11 08:01:35 2001
@@ -2,7 +2,7 @@
  * cmdschan.c -- part of channels.mod
  *   commands from a user via dcc that cause server interaction
  *
- * $Id: cmdschan.c,v 1.53 2001/10/10 10:44:05 tothwolf Exp $
+ * $Id: cmdschan.c,v 1.54 2001/10/11 13:01:35 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1288,7 +1288,7 @@
 
 static void cmd_chanset(struct userrec *u, int idx, char *par)
 {
-  char *chname = NULL, answers[512], *parcpy = NULL;
+  char *chname = NULL, answers[512], *parcpy;
   char *list[2], *bak, *buf;
   struct chanset_t *chan = NULL;
   int all = 0;
Index: eggdrop1.7/src/mod/filesys.mod/dbcompat.c
diff -u eggdrop1.7/src/mod/filesys.mod/dbcompat.c:1.12 eggdrop1.7/src/mod/filesys.mod/dbcompat.c:1.13
--- eggdrop1.7/src/mod/filesys.mod/dbcompat.c:1.12	Wed Oct 10 05:44:06 2001
+++ eggdrop1.7/src/mod/filesys.mod/dbcompat.c	Thu Oct 11 08:01:35 2001
@@ -4,7 +4,7 @@
  *
  * Written for filedb3 by Fabian Knittel <fknittel at gmx.de>
  *
- * $Id: dbcompat.c,v 1.12 2001/10/10 10:44:06 tothwolf Exp $
+ * $Id: dbcompat.c,v 1.13 2001/10/11 13:01:35 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -101,8 +101,8 @@
 	  i = strlen(fn) - 1;
 	  if (fn[i] == '/')
 	    fn[i] = 0;
-	  malloc_strcpy(fdbe->filename, fn);
-	  malloc_strcpy(fdbe->uploader, nick);
+	  realloc_strcpy(fdbe->filename, fn);
+	  realloc_strcpy(fdbe->uploader, nick);
 	  fdbe->gots = atoi(s1);
 	  fdbe->uploaded = atoi(tm);
 	  sprintf(s, "%s/%s", path, fn);
@@ -118,7 +118,7 @@
 		break_down_flags(nick + 1, &fr, NULL);
 		build_flags(x, &fr, NULL);
 		/* We only want valid flags */
-		malloc_strcpy(fdbe->flags_req, x);
+		realloc_strcpy(fdbe->flags_req, x);
 	      }
 	    }
 	    fdbe->size = st.st_size;
@@ -160,18 +160,18 @@
 
 	fdbe->stat = fdb1.stat;
 	if (fdb1.filename[0])
-	  malloc_strcpy(fdbe->filename, fdb1.filename);
+	  realloc_strcpy(fdbe->filename, fdb1.filename);
 	if (fdb1.desc[0])
-	  malloc_strcpy(fdbe->desc, fdb1.desc);
+	  realloc_strcpy(fdbe->desc, fdb1.desc);
 	if (fdb1.uploader[0])
-	  malloc_strcpy(fdbe->uploader, fdb1.uploader);
+	  realloc_strcpy(fdbe->uploader, fdb1.uploader);
 	if (fdb1.flags_req[0])
-	  malloc_strcpy(fdbe->flags_req, fdb1.flags_req);
+	  realloc_strcpy(fdbe->flags_req, fdb1.flags_req);
 	fdbe->uploaded = fdb1.uploaded;
 	fdbe->size = fdb1.size;
 	fdbe->gots = fdb1.gots;
 	if (fdb1.sharelink[0])
-	  malloc_strcpy(fdbe->sharelink, fdb1.sharelink);
+	  realloc_strcpy(fdbe->sharelink, fdb1.sharelink);
 	filedb_addfile(fdb_s, fdbe);
 	free_fdbe(&fdbe);
       }
@@ -197,20 +197,20 @@
 
 	fdbe->stat = fdb2.stat;
 	if (fdb2.filename[0])
-	  malloc_strcpy(fdbe->filename, fdb2.filename);
+	  realloc_strcpy(fdbe->filename, fdb2.filename);
 	if (fdb2.desc[0])
-	  malloc_strcpy(fdbe->desc, fdb2.desc);
+	  realloc_strcpy(fdbe->desc, fdb2.desc);
 	if (fdb2.chname[0])
-	  malloc_strcpy(fdbe->chan, fdb2.chname);
+	  realloc_strcpy(fdbe->chan, fdb2.chname);
 	if (fdb2.uploader[0])
-	  malloc_strcpy(fdbe->uploader, fdb2.uploader);
+	  realloc_strcpy(fdbe->uploader, fdb2.uploader);
 	if (fdb2.flags_req[0])
-	  malloc_strcpy(fdbe->flags_req, fdb2.flags_req);
+	  realloc_strcpy(fdbe->flags_req, fdb2.flags_req);
 	fdbe->uploaded = fdb2.uploaded;
 	fdbe->size = fdb2.size;
 	fdbe->gots = fdb2.gots;
 	if (fdb2.sharelink[0])
-	  malloc_strcpy(fdbe->sharelink, fdb2.sharelink);
+	  realloc_strcpy(fdbe->sharelink, fdb2.sharelink);
 	filedb_addfile(fdb_t, fdbe);
 	free_fdbe(&fdbe);
       }
Index: eggdrop1.7/src/mod/filesys.mod/filedb3.c
diff -u eggdrop1.7/src/mod/filesys.mod/filedb3.c:1.22 eggdrop1.7/src/mod/filesys.mod/filedb3.c:1.23
--- eggdrop1.7/src/mod/filesys.mod/filedb3.c:1.22	Thu Oct 11 06:34:20 2001
+++ eggdrop1.7/src/mod/filesys.mod/filedb3.c	Thu Oct 11 08:01:35 2001
@@ -4,7 +4,7 @@
  *
  * Rewritten by Fabian Knittel <fknittel at gmx.de>
  *
- * $Id: filedb3.c,v 1.22 2001/10/11 11:34:20 tothwolf Exp $
+ * $Id: filedb3.c,v 1.23 2001/10/11 13:01:35 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -648,7 +648,7 @@
   }
   dd = readdir(dir);
   while (dd != NULL) {
-    malloc_strcpy(name, dd->d_name);
+    realloc_strcpy(name, dd->d_name);
     if (name[0] != '.') {
       s = malloc(strlen(path) + strlen(name) + 2);
       sprintf(s, "%s/%s", path, name);
@@ -659,8 +659,8 @@
       if (!fdbe) {
 	/* new file! */
 	fdbe = malloc_fdbe();
-	malloc_strcpy(fdbe->filename, name);
-	malloc_strcpy(fdbe->uploader, botnetnick);
+	realloc_strcpy(fdbe->filename, name);
+	realloc_strcpy(fdbe->uploader, botnetnick);
 	fdbe->uploaded = now;
 	fdbe->size = st.st_size;
 	if (S_ISDIR(st.st_mode))
@@ -717,7 +717,7 @@
 {
     char *s2 = NULL, *p = NULL;
 
-    malloc_strcpy(s2, path);
+    realloc_strcpy(s2, path);
     if (s2[strlen(s2) - 1] == '/')
       s2[strlen(s2) - 1] = 0;		/* remove trailing '/' */
     p = s2;
@@ -852,7 +852,7 @@
   if (!fdbe)
     return;
   free_null(fdbe->uploader);
-  malloc_strcpy(fdbe->uploader, nick);
+  realloc_strcpy(fdbe->uploader, nick);
   fdbe->uploaded = now;
   filedb_updatefile(fdb, fdbe->pos, fdbe, UPDATE_ALL);
   free_fdbe(&fdbe);
@@ -959,7 +959,7 @@
 	  free_null(s3);
 	  /* Causes filename to be displayed on its own line */
 	} else
-	  malloc_strcpy(s3, fdbe->filename);
+	  realloc_strcpy(s3, fdbe->filename);
 	s4 = malloc(69 + strlen(s3 ? s3 : "") + strlen(s1) +
 		     strlen(fdbe->uploader) + strlen(t) + strlen(s2));
 	sprintf(s4, "%-30s %s  %-9s (%s)  %6d%s\n", s3 ? s3 : "", s1,
@@ -1024,14 +1024,14 @@
   int	i   = 0;
   filedb_entry *fdbe = NULL;
 
-  malloc_strcpy(what, file);
+  realloc_strcpy(what, file);
   p = strrchr(what, '/');
   if (p) {
     *p = 0;
-    malloc_strcpy(dir, what);
+    realloc_strcpy(dir, what);
     strcpy(what, p + 1);
   } else {
-    malloc_strcpy(dir, "");
+    realloc_strcpy(dir, "");
   }
   fdb = filedb_open(dir, 0);
   if (!fdb) {
@@ -1101,7 +1101,6 @@
 
   fdbe = filedb_getentry(dir, fn);
   if (fdbe) {
-    *desc = NULL;
     malloc_strcpy(*desc, fdbe->desc);
     free_fdbe(&fdbe);
   } else
@@ -1114,7 +1113,6 @@
 
   fdbe = filedb_getentry(dir, fn);
   if (fdbe) {
-    *owner = NULL;
     malloc_strcpy(*owner, fdbe->uploader);
     free_fdbe(&fdbe);
   } else
@@ -1146,7 +1144,7 @@
   fdbe = filedb_matchfile(fdb, ftell(fdb), fn);
   if (fdbe) {
     free_null(fdbe->desc);
-    malloc_strcpy(fdbe->desc, desc);
+    realloc_strcpy(fdbe->desc, desc);
     filedb_updatefile(fdb, fdbe->pos, fdbe, UPDATE_ALL);
     free_fdbe(&fdbe);
   }
@@ -1165,7 +1163,7 @@
   fdbe = filedb_matchfile(fdb, ftell(fdb), fn);
   if (fdbe) {
     free_null(fdbe->uploader);
-    malloc_strcpy(fdbe->uploader, owner);
+    realloc_strcpy(fdbe->uploader, owner);
     filedb_updatefile(fdb, fdbe->pos, fdbe, UPDATE_ALL);
     free_fdbe(&fdbe);
   }
@@ -1190,7 +1188,7 @@
       filedb_delfile(fdb, fdbe->pos);
     else {
       free_null(fdbe->sharelink);
-      malloc_strcpy(fdbe->sharelink, link);
+      realloc_strcpy(fdbe->sharelink, link);
       filedb_updatefile(fdb, fdbe->pos, fdbe, UPDATE_ALL);
     }
     free_fdbe(&fdbe);
@@ -1198,9 +1196,9 @@
   }
 
   fdbe = malloc_fdbe();
-  malloc_strcpy(fdbe->uploader, botnetnick);
-  malloc_strcpy(fdbe->filename, fn);
-  malloc_strcpy(fdbe->sharelink, link);
+  realloc_strcpy(fdbe->uploader, botnetnick);
+  realloc_strcpy(fdbe->filename, fn);
+  realloc_strcpy(fdbe->sharelink, link);
   fdbe->uploaded = now;
   filedb_addfile(fdb, fdbe);
   free_fdbe(&fdbe);
@@ -1213,7 +1211,6 @@
 
   fdbe = filedb_getentry(dir, fn);
   if (fdbe && (!(fdbe->stat & FILE_DIR))) {
-    *link = NULL;
     malloc_strcpy(*link, fdbe->sharelink);
   } else
     *link = NULL;
Index: eggdrop1.7/src/mod/filesys.mod/files.c
diff -u eggdrop1.7/src/mod/filesys.mod/files.c:1.30 eggdrop1.7/src/mod/filesys.mod/files.c:1.31
--- eggdrop1.7/src/mod/filesys.mod/files.c:1.30	Wed Oct 10 05:44:06 2001
+++ eggdrop1.7/src/mod/filesys.mod/files.c	Thu Oct 11 08:01:35 2001
@@ -2,7 +2,7 @@
  * files.c - part of filesys.mod
  *   handles all file system commands
  *
- * $Id: files.c,v 1.30 2001/10/10 10:44:06 tothwolf Exp $
+ * $Id: files.c,v 1.31 2001/10/11 13:01:35 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -157,7 +157,7 @@
 		     req  = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
 
   *real = NULL;
-  malloc_strcpy(*real, current);
+  realloc_strcpy(*real, current);
   if (!change[0])
     return 1;				/* No change? */
   new = malloc(strlen(change) + 2);	/* Add 2, because we add '/' below */
@@ -173,7 +173,7 @@
   while (p) {
     *p = 0;
     p++;
-    malloc_strcpy(elem, new);
+    realloc_strcpy(elem, new);
     strcpy(new, p);
     if (!(strcmp(elem, ".")) || (!elem[0])) {	/* Do nothing */
     } else if (!strcmp(elem, "..")) {	/* Go back */
@@ -184,7 +184,7 @@
 	if (!(*real)[0]) {
 	  free_null(elem);
 	  free_null(new);
-	  malloc_strcpy(*real, current);
+	  realloc_strcpy(*real, current);
 	  return 0;
 	}
 	(*real)[0] = 0;
@@ -197,7 +197,7 @@
 	/* Non-existent starting point! */
 	free_null(elem);
 	free_null(new);
-	malloc_strcpy(*real, current);
+	realloc_strcpy(*real, current);
 	return 0;
       }
       filedb_readtop(fdb, NULL);
@@ -207,7 +207,7 @@
 	/* Non-existent */
 	free_null(elem);
 	free_null(new);
-	malloc_strcpy(*real, current);
+	realloc_strcpy(*real, current);
 	return 0;
       }
       if (!(fdbe->stat & FILE_DIR) || fdbe->sharelink) {
@@ -215,7 +215,7 @@
 	free_fdbe(&fdbe);
 	free_null(elem);
 	free_null(new);
-	malloc_strcpy(*real, current);
+	realloc_strcpy(*real, current);
 	return 0;
       }
       if (idx >= 0)
@@ -230,18 +230,18 @@
 	  free_fdbe(&fdbe);
 	  free_null(elem);
 	  free_null(new);
-	  malloc_strcpy(*real, current);
+	  realloc_strcpy(*real, current);
 	  return 0;
 	}
       }
       free_fdbe(&fdbe);
-      malloc_strcpy(s, *real);
+      realloc_strcpy(s, *real);
       if (s[0])
 	if (s[strlen(s) - 1] != '/')
 	  strcat(s, "/");
       work = malloc(strlen(s) + strlen(elem) + 1);
       sprintf(work, "%s%s", s, elem);
-      malloc_strcpy(*real, work);
+      realloc_strcpy(*real, work);
       s = realloc(s, strlen(dccdir) + strlen(*real) + 1);
       sprintf(s, "%s%s", dccdir, *real);
     }
@@ -274,16 +274,16 @@
    */
   if ((ppath[0] == '*') || (ppath[0] == '/'))
     return;
-  malloc_strcpy(path, ppath);
+  realloc_strcpy(path, ppath);
   p = strrchr(path, '/');
   if (p != NULL) {
     *p = 0;
-    malloc_strcpy(destdir, path);
-    malloc_strcpy(fn, p + 1);
+    realloc_strcpy(destdir, path);
+    realloc_strcpy(fn, p + 1);
     *p = '/';
   } else {
-    malloc_strcpy(destdir, "");
-    malloc_strcpy(fn, path);
+    realloc_strcpy(destdir, "");
+    realloc_strcpy(fn, path);
   }
   fdb = filedb_open(destdir, 0);
   if (!fdb) {
@@ -361,8 +361,8 @@
     p = strrchr(par, '/');
     if (p != NULL) {
       *p = 0;
-      malloc_strcpy(s, par);
-      malloc_strcpy(mask, p + 1);
+      realloc_strcpy(s, par);
+      realloc_strcpy(mask, p + 1);
       if (!resolve_dir(dcc[idx].u.file->dir, s, &destdir, idx)) {
 	dprintf(idx, _("Illegal directory.\n"));
 	free_null(s);
@@ -372,14 +372,14 @@
       }
       free_null(s);
     } else {
-      malloc_strcpy(destdir, dcc[idx].u.file->dir);
-      malloc_strcpy(mask, par);
+      realloc_strcpy(destdir, dcc[idx].u.file->dir);
+      realloc_strcpy(mask, par);
     }
     /* Might be 'ls dir'? */
     if (resolve_dir(destdir, mask, &s, idx)) {
       /* Aha! it was! */
-      malloc_strcpy(destdir, s);
-      malloc_strcpy(mask, "*");
+      realloc_strcpy(destdir, s);
+      realloc_strcpy(mask, "*");
     }
     free_null(s);
     fdb = filedb_open(destdir, 0);
@@ -443,7 +443,7 @@
   p = strrchr(what, '/');
   if (p != NULL) {
     *p = 0;
-    malloc_strcpy(s, what);
+    realloc_strcpy(s, what);
     strcpy(what, p + 1);
     if (!resolve_dir(dcc[idx].u.file->dir, s, &destdir, idx)) {
       free_null(destdir);
@@ -453,7 +453,7 @@
     }
     free_null(s);
   } else
-    malloc_strcpy(destdir, dcc[idx].u.file->dir);
+    realloc_strcpy(destdir, dcc[idx].u.file->dir);
   fdb = filedb_open(destdir, 0);
   if (!fdb)
     return;
@@ -482,9 +482,9 @@
 	  dprintf(idx, _("%s isnt available right now.\n"), fdbe->filename);
 	} else {
 	  i = nextbot(bot);
-	  malloc_strcpy(whoto, par);
+	  realloc_strcpy(whoto, par);
 	  if (!whoto[0])
-	    malloc_strcpy(whoto, dcc[idx].nick);
+	    realloc_strcpy(whoto, dcc[idx].nick);
 	  s = malloc(strlen(whoto) + strlen(botnetnick) + 13);
 	  simple_sprintf(s, "%d:%s@%s", dcc[idx].sock, whoto, botnetnick);
 	  botnet_send_filereq(i, s, bot, fdbe->sharelink);
@@ -493,7 +493,7 @@
 	  fdbe->gots++;
 	  s = realloc(s, strlen(bot) + strlen(fdbe->sharelink) + 2);
 	  sprintf(s, "%s:%s", bot, fdbe->sharelink);
-	  malloc_strcpy(fdbe->sharelink, s);
+	  realloc_strcpy(fdbe->sharelink, s);
 	  filedb_updatefile(fdb, fdbe->pos, fdbe, UPDATE_ALL);
 	  free_null(whoto);
 	  free_null(s);
@@ -734,7 +734,7 @@
   else {
     if ((p = strrchr(par, '/'))) {
       *p = 0;
-      malloc_strcpy(newfn, p + 1);
+      realloc_strcpy(newfn, p + 1);
       if (!resolve_dir(dcc[idx].u.file->dir, par, &newpath, idx)) {
 	dprintf(idx, _("No such directory.\n"));
 	free_null(newfn);
@@ -742,8 +742,8 @@
 	return;
       }
     } else {
-      malloc_strcpy(newpath, dcc[idx].u.file->dir);
-      malloc_strcpy(newfn, par);
+      realloc_strcpy(newpath, dcc[idx].u.file->dir);
+      realloc_strcpy(newfn, par);
     }
     fdb = filedb_open(newpath, 0);
     if (!fdb) {
@@ -758,7 +758,7 @@
 	dprintf(idx, _("%s is already a normal file.\n"), newfn);
 	filedb_close(fdb);
       } else {
-	malloc_strcpy(fdbe->sharelink, share);
+	realloc_strcpy(fdbe->sharelink, share);
 	filedb_updatefile(fdb, fdbe->pos, fdbe, UPDATE_ALL);
 	filedb_close(fdb);
 	dprintf(idx, _("Changed link to %s\n"), share);
@@ -768,10 +768,10 @@
     } else {
       /* New entry */
       fdbe = malloc_fdbe();
-      malloc_strcpy(fdbe->filename, newfn);
-      malloc_strcpy(fdbe->uploader, dcc[idx].nick);
+      realloc_strcpy(fdbe->filename, newfn);
+      realloc_strcpy(fdbe->uploader, dcc[idx].nick);
       fdbe->uploaded = now;
-      malloc_strcpy(fdbe->sharelink, share);
+      realloc_strcpy(fdbe->sharelink, share);
       filedb_addfile(fdb, fdbe);
       filedb_close(fdb);
       dprintf(idx, "%s %s -> %s\n", _("Added link"), fdbe->filename, share);
@@ -865,7 +865,7 @@
 	    fdbe = filedb_matchfile(fdb, where, fn);
 	    continue;
 	  }
-	  malloc_strcpy(fdbe->desc, desc);
+	  realloc_strcpy(fdbe->desc, desc);
 	} else if (fdbe->desc) {
 	  free_null(fdbe->desc);
 	}
@@ -995,7 +995,7 @@
       free_null(s);
       fdbe = malloc_fdbe();
       fdbe->stat = FILE_DIR;
-      malloc_strcpy(fdbe->filename, name);
+      realloc_strcpy(fdbe->filename, name);
       fdbe->uploaded = now;
       dprintf(idx, "%s /%s%s%s\n", _("Created directory"), dcc[idx].u.file->dir,
 	      dcc[idx].u.file->dir[0] ? "/" : "", name);
@@ -1010,14 +1010,14 @@
 
       break_down_flags(flags, &fr, NULL);
       build_flags(buffer, &fr, NULL);
-      malloc_strcpy(fdbe->flags_req, buffer);
+      realloc_strcpy(fdbe->flags_req, buffer);
       dprintf(idx, _("Changed %s/ to require +%s to access\n"), name, buffer);
     } else if (!chan[0]) {
       free_null(fdbe->flags_req);
       dprintf(idx, _("Changes %s/ to require no flags to access\n"), name);
     }
     if (chan[0]) {
-      malloc_strcpy(fdbe->chan, chan);
+      realloc_strcpy(fdbe->chan, chan);
       dprintf(idx, "Access set to channel: %s\n", chan);
     } else if (!flags[0]) {
       free_null(fdbe->chan);
@@ -1038,7 +1038,7 @@
   filedb_entry *fdbe;
   char *s, *name = NULL;
 
-  malloc_strcpy(name, par);
+  realloc_strcpy(name, par);
   if (name[strlen(name) - 1] == '/')
     name[strlen(name) - 1] = 0;
   if (strchr(name, '/'))
@@ -1109,7 +1109,7 @@
   p = strrchr(fn, '/');
   if (p != NULL) {
     *p = 0;
-    malloc_strcpy(s, fn);
+    realloc_strcpy(s, fn);
     strcpy(fn, p + 1);
     if (!resolve_dir(dcc[idx].u.file->dir, s, &oldpath, idx)) {
       dprintf(idx, _("Illegal source directory.\n"));
@@ -1119,17 +1119,17 @@
     }
     free_null(s);
   } else
-    malloc_strcpy(oldpath, dcc[idx].u.file->dir);
-  malloc_strcpy(s, par);
+    realloc_strcpy(oldpath, dcc[idx].u.file->dir);
+  realloc_strcpy(s, par);
   if (!resolve_dir(dcc[idx].u.file->dir, s, &newpath, idx)) {
     /* Destination is not just a directory */
     p = strrchr(s, '/');
     if (p == NULL) {
-      malloc_strcpy(newfn, s);
+      realloc_strcpy(newfn, s);
       s[0] = 0;
     } else {
       *p = 0;
-      malloc_strcpy(newfn, p + 1);
+      realloc_strcpy(newfn, p + 1);
     }
     if (!resolve_dir(dcc[idx].u.file->dir, s, &newpath, idx)) {
       dprintf(idx, _("Illegal destination directory.\n"));
@@ -1140,7 +1140,7 @@
       return;
     }
   } else
-    malloc_strcpy(newfn, "");
+    realloc_strcpy(newfn, "");
   free_null(s);
   /* Stupidness checks */
   if ((!strcmp(oldpath, newpath)) &&
@@ -1222,19 +1222,19 @@
 	  fdbe_new = malloc_fdbe();
 	  fdbe_new->stat = fdbe_old->stat;
 	  /* We don't have to worry about any entries to be
-	   * NULL, because malloc_strcpy takes care of that.
+	   * NULL, because realloc_strcpy takes care of that.
 	   */
-	  malloc_strcpy(fdbe_new->flags_req, fdbe_old->flags_req);
-	  malloc_strcpy(fdbe_new->chan, fdbe_old->chan);
-	  malloc_strcpy(fdbe_new->filename, fdbe_old->filename);
-	  malloc_strcpy(fdbe_new->desc, fdbe_old->desc);
+	  realloc_strcpy(fdbe_new->flags_req, fdbe_old->flags_req);
+	  realloc_strcpy(fdbe_new->chan, fdbe_old->chan);
+	  realloc_strcpy(fdbe_new->filename, fdbe_old->filename);
+	  realloc_strcpy(fdbe_new->desc, fdbe_old->desc);
 	  if (newfn[0])
-	    malloc_strcpy(fdbe_new->filename, newfn);
-	  malloc_strcpy(fdbe_new->uploader, fdbe_old->uploader);
+	    realloc_strcpy(fdbe_new->filename, newfn);
+	  realloc_strcpy(fdbe_new->uploader, fdbe_old->uploader);
 	  fdbe_new->uploaded = fdbe_old->uploaded;
 	  fdbe_new->size = fdbe_old->size;
 	  fdbe_new->gots = fdbe_old->gots;
-	  malloc_strcpy(fdbe_new->sharelink, fdbe_old->sharelink);
+	  realloc_strcpy(fdbe_new->sharelink, fdbe_old->sharelink);
 	  filedb_addfile(fdb_new, fdbe_new);
 	  if (!copy) {
 	    unlink(s);
@@ -1372,8 +1372,8 @@
   p = strrchr(fn, '/');
   if (p != NULL) {
     *p = 0;
-    malloc_strcpy(s, fn);
-    malloc_strcpy(what, p + 1);
+    realloc_strcpy(s, fn);
+    realloc_strcpy(what, p + 1);
     if (!resolve_dir(dcc[idx].u.file->dir, s, &destdir, idx)) {
       free_null(s);
       free_null(what);
@@ -1382,8 +1382,8 @@
     }
     free_null(s);
   } else {
-    malloc_strcpy(destdir, dcc[idx].u.file->dir);
-    malloc_strcpy(what, fn);
+    realloc_strcpy(destdir, dcc[idx].u.file->dir);
+    realloc_strcpy(what, fn);
   }
   fdb = filedb_open(destdir, 0);
   if (!fdb) {
@@ -1430,9 +1430,9 @@
     } else {
       i = nextbot(bot);
       if (nick[0]) {
-        malloc_strcpy(whoto, nick);
+        realloc_strcpy(whoto, nick);
       } else {
-	malloc_strcpy(whoto, dcc[idx].nick);
+	realloc_strcpy(whoto, dcc[idx].nick);
       }
       s = malloc(strlen(whoto) + strlen(botnetnick) + 13);
       simple_sprintf(s, "%d:%s@%s", dcc[idx].sock, whoto, botnetnick);
@@ -1442,7 +1442,7 @@
       fdbe->gots++;
       s = realloc(s, strlen(bot) + strlen(fdbe->sharelink) + 2);
       sprintf(s, "%s:%s", bot, fdbe->sharelink);
-      malloc_strcpy(fdbe->sharelink, s);
+      realloc_strcpy(fdbe->sharelink, s);
       filedb_updatefile(fdb, fdbe->pos, fdbe, UPDATE_ALL);
       filedb_close(fdb);
       free_fdbe(&fdbe);
Index: eggdrop1.7/src/mod/filesys.mod/filesys.c
diff -u eggdrop1.7/src/mod/filesys.mod/filesys.c:1.53 eggdrop1.7/src/mod/filesys.mod/filesys.c:1.54
--- eggdrop1.7/src/mod/filesys.mod/filesys.c:1.53	Thu Oct 11 06:34:20 2001
+++ eggdrop1.7/src/mod/filesys.mod/filesys.c	Thu Oct 11 08:01:35 2001
@@ -2,7 +2,7 @@
  * filesys.c -- part of filesys.mod
  *   main file of the filesys eggdrop module
  *
- * $Id: filesys.c,v 1.53 2001/10/11 11:34:20 tothwolf Exp $
+ * $Id: filesys.c,v 1.54 2001/10/11 13:01:35 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -401,7 +401,7 @@
   if (strchr(nfn, ' ')) {
     char *p;
 
-    malloc_strcpy(buf, nfn);
+    realloc_strcpy(buf, nfn);
     p = nfn = buf;
     while ((p = strchr(p, ' ')) != NULL)
       *p = '_';
@@ -725,7 +725,7 @@
   int len = dcc[i].u.dns->ibuf, j;
 
   sprintf(prt, "%d", dcc[i].port);
-  malloc_strcpy(param, dcc[i].u.dns->cbuf);
+  realloc_strcpy(param, dcc[i].u.dns->cbuf);
 
   changeover_dcc(i, &DCC_FORK_SEND, sizeof(struct xfer_info));
   if (param[0] == '.')
Index: eggdrop1.7/src/mod/filesys.mod/tclfiles.c
diff -u eggdrop1.7/src/mod/filesys.mod/tclfiles.c:1.15 eggdrop1.7/src/mod/filesys.mod/tclfiles.c:1.16
--- eggdrop1.7/src/mod/filesys.mod/tclfiles.c:1.15	Wed Oct 10 05:44:06 2001
+++ eggdrop1.7/src/mod/filesys.mod/tclfiles.c	Thu Oct 11 08:01:35 2001
@@ -2,7 +2,7 @@
  * tclfiles.c -- part of filesys.mod
  *   Tcl stubs for file system commands moved here to support modules
  *
- * $Id: tclfiles.c,v 1.15 2001/10/10 10:44:06 tothwolf Exp $
+ * $Id: tclfiles.c,v 1.16 2001/10/11 13:01:35 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -184,7 +184,7 @@
   char *s = NULL, *p, *d;
 
   BADARGS(3, 4, " dir ?flags ?channel??");
-  malloc_strcpy(s, argv[1]);
+  realloc_strcpy(s, argv[1]);
   if (s[strlen(s) - 1] == '/')
      s[strlen(s) - 1] = 0;
   p = strrchr(s, '/');
@@ -221,12 +221,12 @@
 
     break_down_flags(argv[2], &fr, NULL);
     build_flags(f, &fr, NULL);
-    malloc_strcpy(fdbe->flags_req, f);
+    realloc_strcpy(fdbe->flags_req, f);
   } else {
     free_null(fdbe->flags_req);
   }
   if (argc == 4)
-    malloc_strcpy(fdbe->chan, argv[3]);
+    realloc_strcpy(fdbe->chan, argv[3]);
 
   filedb_updatefile(fdb, fdbe->pos, fdbe, UPDATE_ALL);
   free_fdbe(&fdbe);
@@ -241,7 +241,7 @@
   char *s = NULL, *p, *d;
 
   BADARGS(2, 2, " dir");
-  malloc_strcpy(s, argv[1]);
+  realloc_strcpy(s, argv[1]);
   if (s[strlen(s) - 1] == '/')
      s[strlen(s) - 1] = 0;
   p = strrchr(s, '/');
@@ -265,7 +265,7 @@
     return TCL_OK;
   }
   if (fdbe->flags_req) {
-    malloc_strcpy(s, fdbe->flags_req);
+    realloc_strcpy(s, fdbe->flags_req);
     if (s[0] == '-')
       s[0] = 0;
   } else
@@ -285,7 +285,7 @@
   struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
 
   BADARGS(2, 4, " dir ?required-flags ?channel??");
-  malloc_strcpy(s, argv[1]);
+  realloc_strcpy(s, argv[1]);
   if (s[strlen(s) - 1] == '/')
      s[strlen(s) - 1] = 0;
   p = strrchr(s, '/');
@@ -319,7 +319,7 @@
     }
     fdbe = malloc_fdbe();
     fdbe->stat = FILE_DIR;
-    malloc_strcpy(fdbe->filename, argv[1]);
+    realloc_strcpy(fdbe->filename, argv[1]);
     fdbe->uploaded = now;
   } else if (!(fdbe->stat & FILE_DIR)) {
     Tcl_AppendResult(irp, "2", NULL);
@@ -333,12 +333,12 @@
 
     break_down_flags(argv[2], &fr, NULL);
     build_flags(f, &fr, NULL);
-    malloc_strcpy(fdbe->flags_req, f);
+    realloc_strcpy(fdbe->flags_req, f);
   } else if (fdbe->flags_req) {
     free_null(fdbe->flags_req);
   }
   if (argc == 4) {
-    malloc_strcpy(fdbe->chan, argv[3]);
+    realloc_strcpy(fdbe->chan, argv[3]);
   } else
     if (fdbe->chan)
       free_null(fdbe->chan);
@@ -359,7 +359,7 @@
   char *s = NULL, *t, *d, *p;
 
   BADARGS(2, 2, " dir");
-  malloc_strcpy(s, argv[1]);
+  realloc_strcpy(s, argv[1]);
   if (s[strlen(s) - 1] == '/')
      s[strlen(s) - 1] = 0;
   p = strrchr(s, '/');
@@ -427,11 +427,11 @@
   long where;
 
   BADARGS(3, 3, " oldfilepath newfilepath");
-  malloc_strcpy(fn, argv[1]);
+  realloc_strcpy(fn, argv[1]);
   p = strrchr(fn, '/');
   if (p != NULL) {
     *p = 0;
-    malloc_strcpy(s, fn);
+    realloc_strcpy(s, fn);
     strcpy(fn, p + 1);
     if (!resolve_dir("/", s, &oldpath, -1)) {
       /* Tcl can do * anything */
@@ -442,17 +442,17 @@
     }
     free_null(s);
   } else
-    malloc_strcpy(oldpath, "/");
-  malloc_strcpy(s, argv[2]);
+    realloc_strcpy(oldpath, "/");
+  realloc_strcpy(s, argv[2]);
   if (!resolve_dir("/", s, &newpath, -1)) {
     /* Destination is not just a directory */
     p = strrchr(s, '/');
     if (!p) {
-      malloc_strcpy(newfn, s);
+      realloc_strcpy(newfn, s);
       s[0] = 0;
     } else {
       *p = 0;
-      malloc_strcpy(newfn, p + 1);
+      realloc_strcpy(newfn, p + 1);
     }
     free_null(newpath);
     if (!resolve_dir("/", s, &newpath, -1)) {
@@ -463,7 +463,7 @@
       return TCL_OK;
     }
   } else
-    malloc_strcpy(newfn, "");
+    realloc_strcpy(newfn, "");
   free_null(s);
 
   /* Stupidness checks */
@@ -553,19 +553,19 @@
 	  fdbe_new = malloc_fdbe();
 	  fdbe_new->stat = fdbe_old->stat;
 	  /* We don't have to worry about any entries to be
-	   * NULL, because malloc_strcpy takes care of that.
+	   * NULL, because realloc_strcpy takes care of that.
 	   */
-	  malloc_strcpy(fdbe_new->flags_req, fdbe_old->flags_req);
-	  malloc_strcpy(fdbe_new->chan, fdbe_old->chan);
-	  malloc_strcpy(fdbe_new->filename, fdbe_old->filename);
-	  malloc_strcpy(fdbe_new->desc, fdbe_old->desc);
+	  realloc_strcpy(fdbe_new->flags_req, fdbe_old->flags_req);
+	  realloc_strcpy(fdbe_new->chan, fdbe_old->chan);
+	  realloc_strcpy(fdbe_new->filename, fdbe_old->filename);
+	  realloc_strcpy(fdbe_new->desc, fdbe_old->desc);
 	  if (newfn[0])
-	    malloc_strcpy(fdbe_new->filename, newfn);
-	  malloc_strcpy(fdbe_new->uploader, fdbe_old->uploader);
+	    realloc_strcpy(fdbe_new->filename, newfn);
+	  realloc_strcpy(fdbe_new->uploader, fdbe_old->uploader);
 	  fdbe_new->uploaded = fdbe_old->uploaded;
 	  fdbe_new->size = fdbe_old->size;
 	  fdbe_new->gots = fdbe_old->gots;
-	  malloc_strcpy(fdbe_new->sharelink, fdbe_old->sharelink);
+	  realloc_strcpy(fdbe_new->sharelink, fdbe_old->sharelink);
 	  filedb_addfile(fdb_new, fdbe_new);
 	  if (!copy) {
 	    unlink(s);
Index: eggdrop1.7/src/mod/notes.mod/notes.c
diff -u eggdrop1.7/src/mod/notes.mod/notes.c:1.37 eggdrop1.7/src/mod/notes.mod/notes.c:1.38
--- eggdrop1.7/src/mod/notes.mod/notes.c:1.37	Wed Oct 10 13:37:55 2001
+++ eggdrop1.7/src/mod/notes.mod/notes.c	Thu Oct 11 08:01:36 2001
@@ -5,7 +5,7 @@
  *   note cmds
  *   note ignores
  *
- * $Id: notes.c,v 1.37 2001/10/10 18:37:55 stdarg Exp $
+ * $Id: notes.c,v 1.38 2001/10/11 13:01:36 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -941,7 +941,7 @@
 int get_note_ignores(struct userrec *u, char ***ignores)
 {
   struct xtra_key *xk;
-  char *buf = NULL, *p;
+  char *buf, *p;
   int ignoresn;
 
   /* Hullo? sanity? */
Index: eggdrop1.7/src/mod/transfer.mod/transfer.c
diff -u eggdrop1.7/src/mod/transfer.mod/transfer.c:1.46 eggdrop1.7/src/mod/transfer.mod/transfer.c:1.47
--- eggdrop1.7/src/mod/transfer.mod/transfer.c:1.46	Thu Oct 11 06:34:21 2001
+++ eggdrop1.7/src/mod/transfer.mod/transfer.c	Thu Oct 11 08:01:36 2001
@@ -1,7 +1,7 @@
 /*
  * transfer.c -- part of transfer.mod
  *
- * $Id: transfer.c,v 1.46 2001/10/11 11:34:21 tothwolf Exp $
+ * $Id: transfer.c,v 1.47 2001/10/11 13:01:36 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -187,7 +187,7 @@
  */
 static char *replace_spaces(char *fn)
 {
-  register char *ret = NULL, *p;
+  register char *ret, *p;
 
   malloc_strcpy(ret, fn);
   p = ret;
@@ -315,7 +315,7 @@
 static void send_next_file(char *to)
 {
   fileq_t *q, *this = NULL;
-  char *s, *s1 = NULL;
+  char *s, *s1;
   int x;
 
   for (q = fileq; q; q = q->next)
@@ -561,7 +561,7 @@
 
 static int tcl_dccsend STDVAR
 {
-  char s[10], *sys = NULL, *nfn;
+  char s[10], *sys, *nfn;
   int i;
   FILE *f;
 
Index: eggdrop1.7/src/net.c
diff -u eggdrop1.7/src/net.c:1.42 eggdrop1.7/src/net.c:1.43
--- eggdrop1.7/src/net.c:1.42	Wed Oct 10 05:44:04 2001
+++ eggdrop1.7/src/net.c	Thu Oct 11 08:01:35 2001
@@ -2,7 +2,7 @@
  * net.c -- handles:
  *   all raw network i/o
  * 
- * $Id: net.c,v 1.42 2001/10/10 10:44:04 tothwolf Exp $
+ * $Id: net.c,v 1.43 2001/10/11 13:01:35 tothwolf Exp $
  */
 /* 
  * This is hereby released into the public domain.
@@ -709,7 +709,7 @@
 {
     char name[UHOSTLEN];
 #ifdef IPV6
-    char *orign2 = NULL;
+    char *orign2;
 #endif
 
     if (!aw) {
----------------------- End of diff -----------------------



More information about the Changes mailing list