[cvslog] Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Wed Oct 17 21:59:00 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2001-10-18 02:58:02 UTC
Commited by: stdarg <stdarg at techmonkeys.org>

Modified files:
     src/modules.c src/net.c src/proto.h src/mod/module.h
     src/mod/filesys.mod/filesys.c src/mod/server.mod/servmsg.c
     src/mod/share.mod/share.c src/mod/transfer.mod/transfer.c

Log message:

Converted my_atoul to sscanf.

---------------------- diff included ----------------------
Index: eggdrop1.7/src/mod/filesys.mod/filesys.c
diff -u eggdrop1.7/src/mod/filesys.mod/filesys.c:1.56 eggdrop1.7/src/mod/filesys.mod/filesys.c:1.57
--- eggdrop1.7/src/mod/filesys.mod/filesys.c:1.56	Tue Oct 16 19:19:17 2001
+++ eggdrop1.7/src/mod/filesys.mod/filesys.c	Wed Oct 17 21:57:51 2001
@@ -2,7 +2,7 @@
  * filesys.c -- part of filesys.mod
  *   main file of the filesys eggdrop module
  *
- * $Id: filesys.c,v 1.56 2001/10/17 00:19:17 stdarg Exp $
+ * $Id: filesys.c,v 1.57 2001/10/18 02:57:51 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -849,8 +849,11 @@
       putlog(LOG_FILES, "*", "%s: %s!%s", _("Refused DCC chat (invalid port)"), nick, from);
 
     } else {
+      unsigned int ip_int;
+
       i = new_dcc(&DCC_FILES_PASS, sizeof(struct file_info));
-      strcpy(dcc[i].addr, iptostr(htonl(my_atoul(ip))));
+      sscanf(ip, "%u", &ip_int);
+      strcpy(dcc[i].addr, iptostr(htonl(ip_int)));
       dcc[i].port = atoi(prt);
       dcc[i].sock = sock;
       strcpy(dcc[i].nick, u->handle);
Index: eggdrop1.7/src/mod/module.h
diff -u eggdrop1.7/src/mod/module.h:1.67 eggdrop1.7/src/mod/module.h:1.68
--- eggdrop1.7/src/mod/module.h:1.67	Tue Oct 16 19:19:17 2001
+++ eggdrop1.7/src/mod/module.h	Wed Oct 17 21:57:51 2001
@@ -1,7 +1,7 @@
 /*
  * module.h
  *
- * $Id: module.h,v 1.67 2001/10/17 00:19:17 stdarg Exp $
+ * $Id: module.h,v 1.68 2001/10/18 02:57:51 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -194,7 +194,7 @@
 /* 88 - 91 */
 #define check_bind_event ((void * (*) (const char *))global[88])
 /* 89: my_memcpy / egg_memcpy -- UNUSED (Tothwolf) */
-#define my_atoul ((IP(*)(char *))global[90])
+/* #define my_atoul ((IP(*)(char *))global[90]) */
 #define my_strcpy ((int (*)(char *, const char *))global[91])
 /* 92 - 95 */
 #define dcc (*(struct dcc_t **)global[92])
Index: eggdrop1.7/src/mod/server.mod/servmsg.c
diff -u eggdrop1.7/src/mod/server.mod/servmsg.c:1.77 eggdrop1.7/src/mod/server.mod/servmsg.c:1.78
--- eggdrop1.7/src/mod/server.mod/servmsg.c:1.77	Tue Oct 16 06:42:30 2001
+++ eggdrop1.7/src/mod/server.mod/servmsg.c	Wed Oct 17 21:57:52 2001
@@ -1,7 +1,7 @@
 /*
  * servmsg.c -- part of server.mod
  *
- * $Id: servmsg.c,v 1.77 2001/10/16 11:42:30 tothwolf Exp $
+ * $Id: servmsg.c,v 1.78 2001/10/18 02:57:52 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -639,10 +639,13 @@
  */
 static int gotpong(char *from, char *ignore, char *msg)
 {
+  unsigned int arg;
+
   newsplit(&msg);
   fixcolon(msg);		/* Scrap server name */
   waiting_for_awake = 0;
-  server_lag = now - my_atoul(msg);
+  sscanf(msg, "%u", &arg);
+  server_lag = now - arg;
   if (server_lag > 99999) {
     /* IRCnet lagmeter support by drummer */
     server_lag = now - lastpingtime;
Index: eggdrop1.7/src/mod/share.mod/share.c
diff -u eggdrop1.7/src/mod/share.mod/share.c:1.62 eggdrop1.7/src/mod/share.mod/share.c:1.63
--- eggdrop1.7/src/mod/share.mod/share.c:1.62	Thu Oct 11 13:24:03 2001
+++ eggdrop1.7/src/mod/share.mod/share.c	Wed Oct 17 21:57:52 2001
@@ -1,7 +1,7 @@
 /*
  * share.c -- part of share.mod
  *
- * $Id: share.c,v 1.62 2001/10/11 18:24:03 tothwolf Exp $
+ * $Id: share.c,v 1.63 2001/10/18 02:57:52 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1134,8 +1134,11 @@
       dprintf(idx, "s e Can't connect to you!\n");
       zapfbot(idx);
     } else {
+      unsigned int ip_int;
+
       i = new_dcc(&DCC_FORK_SEND, sizeof(struct xfer_info));
-      strcpy(dcc[i].addr, iptostr(htonl(my_atoul(ip))));
+      sscanf(ip, "%u", &ip_int);
+      strcpy(dcc[i].addr, iptostr(htonl(ip_int)));
       dcc[i].port = atoi(port);
       strcpy(dcc[i].nick, "*users");
       malloc_strcpy(dcc[i].u.xfer->filename, s);
Index: eggdrop1.7/src/mod/transfer.mod/transfer.c
diff -u eggdrop1.7/src/mod/transfer.mod/transfer.c:1.49 eggdrop1.7/src/mod/transfer.mod/transfer.c:1.50
--- eggdrop1.7/src/mod/transfer.mod/transfer.c:1.49	Tue Oct 16 19:19:17 2001
+++ eggdrop1.7/src/mod/transfer.mod/transfer.c	Wed Oct 17 21:57:52 2001
@@ -1,7 +1,7 @@
 /*
  * transfer.c -- part of transfer.mod
  *
- * $Id: transfer.c,v 1.49 2001/10/17 00:19:17 stdarg Exp $
+ * $Id: transfer.c,v 1.50 2001/10/18 02:57:52 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1794,7 +1794,7 @@
     return 0;
   fn = newsplit(&msg);
   port = atoi(newsplit(&msg));
-  offset = my_atoul(newsplit(&msg));
+  sscanf(newsplit(&msg), "%ul", &offset);
   /* Search for existing SEND */
   for (i = 0; i < dcc_total; i++)
     if ((dcc[i].type == &DCC_GET_PENDING) &&
Index: eggdrop1.7/src/modules.c
diff -u eggdrop1.7/src/modules.c:1.74 eggdrop1.7/src/modules.c:1.75
--- eggdrop1.7/src/modules.c:1.74	Tue Oct 16 19:19:16 2001
+++ eggdrop1.7/src/modules.c	Wed Oct 17 21:57:51 2001
@@ -4,7 +4,7 @@
  * 
  * by Darrin Smith (beldin at light.iinet.net.au)
  * 
- * $Id: modules.c,v 1.74 2001/10/17 00:19:16 stdarg Exp $
+ * $Id: modules.c,v 1.75 2001/10/18 02:57:51 stdarg Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -252,7 +252,7 @@
   /* 88 - 91 */
   (Function) check_bind_event,
   (Function) 0,
-  (Function) my_atoul,
+  (Function) 0,
   (Function) my_strcpy,
   /* 92 - 95 */
   (Function) & dcc,		 /* struct dcc_t *			*/
Index: eggdrop1.7/src/net.c
diff -u eggdrop1.7/src/net.c:1.46 eggdrop1.7/src/net.c:1.47
--- eggdrop1.7/src/net.c:1.46	Sat Oct 13 07:00:22 2001
+++ eggdrop1.7/src/net.c	Wed Oct 17 21:57:51 2001
@@ -2,7 +2,7 @@
  * net.c -- handles:
  *   all raw network i/o
  * 
- * $Id: net.c,v 1.46 2001/10/13 12:00:22 stdarg Exp $
+ * $Id: net.c,v 1.47 2001/10/18 02:57:51 stdarg Exp $
  */
 /* 
  * This is hereby released into the public domain.
@@ -65,21 +65,6 @@
 /* Types of proxy */
 #define PROXY_SOCKS   1
 #define PROXY_SUN     2
-
-
-/* I need an UNSIGNED long for dcc type stuff
- */
-IP my_atoul(char *s)
-{
-  IP ret = 0;
-
-  while ((*s >= '0') && (*s <= '9')) {
-    ret *= 10;
-    ret += ((*s) - '0');
-    s++;
-  }
-  return ret;
-}
 
 /* Initialize the socklist
  */
Index: eggdrop1.7/src/proto.h
diff -u eggdrop1.7/src/proto.h:1.56 eggdrop1.7/src/proto.h:1.57
--- eggdrop1.7/src/proto.h:1.56	Sat Oct 13 10:55:33 2001
+++ eggdrop1.7/src/proto.h	Wed Oct 17 21:57:51 2001
@@ -7,7 +7,7 @@
  * because they use structures in those
  * (saves including those .h files EVERY time) - Beldin
  *
- * $Id: proto.h,v 1.56 2001/10/13 15:55:33 tothwolf Exp $
+ * $Id: proto.h,v 1.57 2001/10/18 02:57:51 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -209,7 +209,6 @@
 void kill_bot(char *, char *);
 
 /* net.c */
-IP my_atoul(char *);
 unsigned long iptolong(IP);
 IP getmyip();
 struct in6_addr getmyip6();
----------------------- End of diff -----------------------



More information about the Changes mailing list