Loading src/tool_metalink.c +8 −14 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ #ifdef USE_METALINK #ifdef USE_METALINK #include <sys/stat.h> #include <sys/stat.h> #include <stdlib.h> #ifdef HAVE_FCNTL_H #ifdef HAVE_FCNTL_H # include <fcntl.h> # include <fcntl.h> Loading Loading @@ -92,8 +93,6 @@ struct win32_crypto_hash { # error "Can't compile METALINK support without a crypto library." # error "Can't compile METALINK support without a crypto library." #endif #endif #include "strcase.h" #define ENABLE_CURLX_PRINTF #define ENABLE_CURLX_PRINTF /* use our own printf() functions */ /* use our own printf() functions */ #include "curlx.h" #include "curlx.h" Loading Loading @@ -563,18 +562,13 @@ int Curl_digest_final(digest_context *context, unsigned char *result) static unsigned char hex_to_uint(const char *s) static unsigned char hex_to_uint(const char *s) { { int v[2]; char buf[3]; int i; unsigned long val; for(i = 0; i < 2; ++i) { buf[0] = s[0]; v[i] = Curl_raw_toupper(s[i]); buf[1] = s[1]; if('0' <= v[i] && v[i] <= '9') { buf[2] = 0; v[i] -= '0'; val = strtoul(buf, NULL, 16); } return (unsigned char)(val&0xff); else if('A' <= v[i] && v[i] <= 'Z') { v[i] -= 'A'-10; } } return (unsigned char)((v[0] << 4) | v[1]); } } /* /* Loading Loading
src/tool_metalink.c +8 −14 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ #ifdef USE_METALINK #ifdef USE_METALINK #include <sys/stat.h> #include <sys/stat.h> #include <stdlib.h> #ifdef HAVE_FCNTL_H #ifdef HAVE_FCNTL_H # include <fcntl.h> # include <fcntl.h> Loading Loading @@ -92,8 +93,6 @@ struct win32_crypto_hash { # error "Can't compile METALINK support without a crypto library." # error "Can't compile METALINK support without a crypto library." #endif #endif #include "strcase.h" #define ENABLE_CURLX_PRINTF #define ENABLE_CURLX_PRINTF /* use our own printf() functions */ /* use our own printf() functions */ #include "curlx.h" #include "curlx.h" Loading Loading @@ -563,18 +562,13 @@ int Curl_digest_final(digest_context *context, unsigned char *result) static unsigned char hex_to_uint(const char *s) static unsigned char hex_to_uint(const char *s) { { int v[2]; char buf[3]; int i; unsigned long val; for(i = 0; i < 2; ++i) { buf[0] = s[0]; v[i] = Curl_raw_toupper(s[i]); buf[1] = s[1]; if('0' <= v[i] && v[i] <= '9') { buf[2] = 0; v[i] -= '0'; val = strtoul(buf, NULL, 16); } return (unsigned char)(val&0xff); else if('A' <= v[i] && v[i] <= 'Z') { v[i] -= 'A'-10; } } return (unsigned char)((v[0] << 4) | v[1]); } } /* /* Loading