Commit 4d17d687 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

Dan Fandrich's cleanup patch to make pedantic compiler options cause less

warnings. Minor edits by me.
parent 0d6236f7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@
#include "urldata.h"
#include "sendf.h"
#include "if2ip.h"
#include "connect.h"

/* The last #include file should be: */
#ifdef CURLDEBUG
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@
#include <curl/curl.h>
#include <curl/types.h>
#include "sendf.h"
#include "content_encoding.h"

#define DSIZ 0x10000             /* buffer size for decompressed data */

+10 −10
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ Curl_cookie_add(struct SessionHandle *data,
            /* note that this name may or may not have a preceeding dot, but
               we don't care about that, we treat the names the same anyway */

            char *ptr=whatptr;
            const char *domptr=whatptr;
            int dotcount=1;
            unsigned int i;

@@ -224,15 +224,15 @@ Curl_cookie_add(struct SessionHandle *data,

            if('.' == whatptr[0])
              /* don't count the initial dot, assume it */
              ptr++;
              domptr++;

            do {
              ptr = strchr(ptr, '.');
              if(ptr) {
                ptr++;
              domptr = strchr(domptr, '.');
              if(domptr) {
                domptr++;
                dotcount++;
              }
            } while(ptr);
            } while(domptr);

            for(i=0;
                i<sizeof(seventhree)/sizeof(seventhree[0]); i++) {
@@ -259,10 +259,10 @@ Curl_cookie_add(struct SessionHandle *data,
                 or the given domain is not valid and thus cannot be set. */

              if(!domain || tailmatch(whatptr, domain)) {
                char *ptr=whatptr;
                if(ptr[0] == '.')
                  ptr++;
                co->domain=strdup(ptr); /* dont prefix with dots internally */
                const char *tailptr=whatptr;
                if(tailptr[0] == '.')
                  tailptr++;
                co->domain=strdup(tailptr); /* don't prefix w/dots internally */
                co->tailmatch=TRUE; /* we always do that if the domain name was
                                       given */
              }
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@

#include "progress.h"
#include "strequal.h"
#include "dict.h"

#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
+8 −8
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ char *curl_escape(const char *string, int length)
  char *testing_ptr = NULL;
  unsigned char in;
  int newlen = alloc;
  int index=0;
  int strindex=0;

  length = alloc-1;
  while(length--) {
@@ -65,17 +65,17 @@ char *curl_escape(const char *string, int length)
          ns = testing_ptr;
        }
      }
      sprintf(&ns[index], "%%%02X", in);
      sprintf(&ns[strindex], "%%%02X", in);

      index+=3;
      strindex+=3;
    }
    else {
      /* just copy this */
      ns[index++]=in;
      ns[strindex++]=in;
    }
    string++;
  }
  ns[index]=0; /* terminate it */
  ns[strindex]=0; /* terminate it */
  return ns;
}

@@ -88,7 +88,7 @@ char *curl_unescape(const char *string, int length)
  int alloc = (length?length:(int)strlen(string))+1;
  char *ns = malloc(alloc);
  unsigned char in;
  int index=0;
  int strindex=0;
  unsigned int hex;
 
  if( !ns ) {
@@ -112,10 +112,10 @@ char *curl_unescape(const char *string, int length)
      alloc-=2;
    }
    
    ns[index++] = in;
    ns[strindex++] = in;
    string++;
  }
  ns[index]=0; /* terminate it */
  ns[strindex]=0; /* terminate it */
  return ns;
}

Loading