Forráskód Böngészése

* my_atoul should use a const char*

Bryan Drewery 17 éve
szülő
commit
cc681da0a7
2 módosított fájl, 3 hozzáadás és 3 törlés
  1. 2 2
      src/net.c
  2. 1 1
      src/net.h

+ 2 - 2
src/net.c

@@ -91,14 +91,14 @@ port_t firewallport = 1080;    /* Default port of Sock4/5 firewalls        */
 
 
 /* I need an UNSIGNED long for dcc type stuff
 /* I need an UNSIGNED long for dcc type stuff
  */
  */
-unsigned long my_atoul(char *s)
+unsigned long my_atoul(const char *s)
 {
 {
   unsigned long ret = 0;
   unsigned long ret = 0;
 
 
   while ((*s >= '0') && (*s <= '9')) {
   while ((*s >= '0') && (*s <= '9')) {
     ret *= 10;
     ret *= 10;
     ret += ((*s) - '0');
     ret += ((*s) - '0');
-    s++;
+    ++s;
   }
   }
   return ret;
   return ret;
 }
 }

+ 1 - 1
src/net.h

@@ -111,7 +111,7 @@ typedef struct {
 
 
 # define killsock(x)     	real_killsock((x),__FILE__,__LINE__)
 # define killsock(x)     	real_killsock((x),__FILE__,__LINE__)
 
 
-unsigned long my_atoul(char *);
+unsigned long my_atoul(const char *);
 #ifdef HAVE_SSL
 #ifdef HAVE_SSL
 int ssl_cleanup();
 int ssl_cleanup();
 int ssl_link(int, int);
 int ssl_link(int, int);