diff lib/misc.c @ 765:d553d14a2565

2006-7-13 Brian Masney <masneyb@gftp.org> * lib/cache.c lib/config_file.c lib/fsp.c lib/ftps.c lib/gftp.h lib/local.c lib/misc.c lib/options.h lib/protocols.c lib/rfc2068.c lib/rfc959.c lib/sshv2.c - started to add some annotations for splint. Fixed a few minor warnings from splint.
author masneyb
date Fri, 14 Jul 2006 00:34:11 +0000
parents 9b68dc473807
children f6a3f5677339
line wrap: on
line diff
--- a/lib/misc.c	Fri Jul 07 20:04:42 2006 +0000
+++ b/lib/misc.c	Fri Jul 14 00:34:11 2006 +0000
@@ -41,7 +41,7 @@
 {
   char *frompos, *topos, src[50], *dest;
   size_t num, rem, srclen;
-  int len, i;
+  size_t len, i;
 
   g_snprintf (src, sizeof (src), GFTP_OFF_T_PRINTF_MOD, number);
 
@@ -289,7 +289,6 @@
       else if(*wcpos++ != *filepos++) 
         return(0);
     }
-  return (1);
 }
 
 
@@ -964,7 +963,7 @@
   if (slen % 3 > 0)
     num++;
 
-  newstr = g_malloc (num * 4 + 1);
+  newstr = g_malloc ((gulong) num * 4 + 1);
   newstr[num * 4] = '\0';
   newpos = newstr;
 
@@ -1155,7 +1154,7 @@
         }
       
       retlen += len;
-      ret = g_realloc (ret, retlen + 1);
+      ret = g_realloc (ret, (gulong) retlen + 1);
 
       /* Don't append a / for VMS servers... */
       if (add_separator &&
@@ -1201,12 +1200,12 @@
   if (strcmp (password, "@EMAIL@") == 0)
     return (g_strdup (password));
 
-  newstr = g_malloc (strlen (password) * 2 + 2);
+  newstr = g_malloc ((gulong) strlen (password) * 2 + 2);
   newpos = newstr;
   
   *newpos++ = '$';
 
-  while (*password != 0)
+  while (*password != '\0')
     {
       *newpos++ = ((*password >> 2) & 0x3c) | 0x41;
       *newpos++ = ((*password << 2) & 0x3c) | 0x41;
@@ -1229,11 +1228,11 @@
     return (g_strdup (password));
 
   passwordpos = password + 1;
-  newstr = g_malloc (strlen (passwordpos) / 2 + 1);
+  newstr = g_malloc ((gulong) strlen (passwordpos) / 2 + 1);
   newpos = newstr;
  
   error = 0;
-  while (*passwordpos != '\0' && (*passwordpos + 1) != '\0')
+  while (*passwordpos != '\0' && *(passwordpos + 1) != '\0')
     {
       if ((*passwordpos & 0xc3) != 0x41 ||
           (*(passwordpos + 1) & 0xc3) != 0x41)