fixed
This commit is contained in:
parent
ea661e7148
commit
5871a87dbd
2
Makefile
2
Makefile
@ -1,4 +1,4 @@
|
||||
CFLAGS?=-pedantic -O0 -s -Wall
|
||||
CFLAGS?=-pedantic -O3 -s -Wall -Wextra
|
||||
CC?=cc
|
||||
|
||||
all:
|
||||
|
@ -29,10 +29,10 @@ char *dir = ".";
|
||||
|
||||
char *prog_name;
|
||||
int ifd;
|
||||
int ifd_clients;
|
||||
size_t ifd_clients;
|
||||
|
||||
int ofd;
|
||||
int ofd_clients;
|
||||
size_t ofd_clients;
|
||||
|
||||
enum {
|
||||
OUTPUT,
|
||||
@ -85,7 +85,7 @@ char *rand_string(void) {
|
||||
if (res == NULL)
|
||||
return NULL;
|
||||
|
||||
for (int i = 0; i < name_len; i++)
|
||||
for (size_t i = 0; i < name_len; i++)
|
||||
res[i] = abc[rand() % (sizeof(abc) - 1)];
|
||||
|
||||
res[name_len] = '\0';
|
||||
@ -158,7 +158,7 @@ void upload(int cfd, pid_t par) {
|
||||
break;
|
||||
|
||||
tbytes += rbytes;
|
||||
if (tbytes / 1024 / 1024 >= max_size) {
|
||||
if (tbytes / 1024 / 1024 >= (ssize_t)max_size) {
|
||||
send_str(cfd, MSG2, sizeof(MSG2), WRITE);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user