@@ -329,34 +329,6 @@ static void winhttp_stream_close(winhttp_stream *s)
329329 s -> sent_request = 0 ;
330330}
331331
332- /**
333- * Extract the url and password from a URL. The outputs are pointers
334- * into the input.
335- */
336- static int userpass_from_url (wchar_t * * user , int * user_len ,
337- wchar_t * * pass , int * pass_len ,
338- const wchar_t * url , int url_len )
339- {
340- URL_COMPONENTS components = { 0 };
341-
342- components .dwStructSize = sizeof (components );
343- /* These tell WinHttpCrackUrl that we're interested in the fields */
344- components .dwUserNameLength = 1 ;
345- components .dwPasswordLength = 1 ;
346-
347- if (!WinHttpCrackUrl (url , url_len , 0 , & components )) {
348- giterr_set (GITERR_OS , "failed to extract user/pass from url" );
349- return -1 ;
350- }
351-
352- * user = components .lpszUserName ;
353- * user_len = components .dwUserNameLength ;
354- * pass = components .lpszPassword ;
355- * pass_len = components .dwPasswordLength ;
356-
357- return 0 ;
358- }
359-
360332#define SCHEME_HTTP "http://"
361333#define SCHEME_HTTPS "https://"
362334
@@ -659,7 +631,7 @@ static int write_chunk(HINTERNET request, const char *buffer, size_t len)
659631 git_buf buf = GIT_BUF_INIT ;
660632
661633 /* Chunk header */
662- git_buf_printf (& buf , "%X \r\n" , len );
634+ git_buf_printf (& buf , "%" PRIXZ " \r\n" , len );
663635
664636 if (git_buf_oom (& buf ))
665637 return -1 ;
@@ -747,7 +719,7 @@ static void CALLBACK winhttp_status(
747719 else if ((status & WINHTTP_CALLBACK_STATUS_FLAG_SECURITY_CHANNEL_ERROR ))
748720 giterr_set (GITERR_NET , "security libraries could not be loaded" );
749721 else
750- giterr_set (GITERR_NET , "unknown security error %d " , status );
722+ giterr_set (GITERR_NET , "unknown security error %lu " , status );
751723}
752724
753725static int winhttp_connect (
@@ -870,7 +842,7 @@ static int do_send_request(winhttp_stream *s, size_t len, int ignore_length)
870842 len , 0 );
871843 }
872844
873- if (success || GetLastError () != SEC_E_BUFFER_TOO_SMALL )
845+ if (success || GetLastError () != ( DWORD ) SEC_E_BUFFER_TOO_SMALL )
874846 break ;
875847 }
876848
@@ -1170,7 +1142,7 @@ static int winhttp_stream_read(
11701142 }
11711143
11721144 if (HTTP_STATUS_OK != status_code ) {
1173- giterr_set (GITERR_NET , "request failed with status code: %d " , status_code );
1145+ giterr_set (GITERR_NET , "request failed with status code: %lu " , status_code );
11741146 return -1 ;
11751147 }
11761148
0 commit comments