Skip to content

Commit 4256469

Browse files
committed
Fix warnings
1 parent d05176c commit 4256469

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

httpsget.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#include <x68k/iocs.h>
1515
#endif
1616

17-
char request[65536];
18-
char response[65536];
17+
uint8_t request[65536];
18+
uint8_t response[65536];
1919

2020
/*
2121
* Shift_JISの文字かどうかを判定
@@ -281,10 +281,7 @@ int main(int argc, char **argv)
281281
char *hostname = NULL;
282282
char *path = NULL;
283283
int port = 0;
284-
int bytes_sent, bytes_received;
285-
int total_received = 0;
286-
int status_code;
287-
int i;
284+
int bytes_sent;
288285

289286
// デフォルト値のリセット(オプション処理後)
290287
hostname = "www.yahoo.co.jp";
@@ -357,7 +354,7 @@ int main(int argc, char **argv)
357354
}
358355

359356
// HTTP GETリクエストの作成
360-
snprintf(request, sizeof(request),
357+
snprintf((char *)request, sizeof(request),
361358
"GET %s HTTP/1.0\r\n"
362359
"Host: %s\r\n"
363360
"User-Agent: X68000-HTTPS-Client/1.0\r\n"
@@ -373,7 +370,7 @@ int main(int argc, char **argv)
373370

374371

375372
// HTTPリクエストを送信
376-
bytes_sent = ssl_write(ssl_sock, request, strlen(request));
373+
bytes_sent = ssl_write(ssl_sock, request, strlen((char *)request));
377374
if (bytes_sent < 0) {
378375
perror("send() failed");
379376
close(client_fd);
@@ -386,8 +383,6 @@ int main(int argc, char **argv)
386383

387384
// HTTPレスポンスを受信してバッファに蓄積
388385
memset(response, 0, sizeof(response));
389-
total_received = 0;
390-
391386

392387
uint8_t *buffer;
393388
size_t buffer_size;
@@ -408,7 +403,7 @@ int main(int argc, char **argv)
408403
if (res > 0) {
409404
buffer_size += res;
410405
buffer = realloc(buffer, buffer_size);
411-
strcat(buffer, ptr);
406+
strcat((char *)buffer, (char *)ptr);
412407
}
413408
putchar('.');
414409
fflush(stdout);

0 commit comments

Comments
 (0)