fixed
This commit is contained in:
parent
a19419ccae
commit
e409d6e7eb
10
plainbin.c
10
plainbin.c
@ -106,14 +106,13 @@ char rand_name(char *buf) {
|
|||||||
for (size_t i = 0; i < cfg.name_len; i++)
|
for (size_t i = 0; i < cfg.name_len; i++)
|
||||||
buf[i] = abc[rand() % (sizeof(abc) - 1)];
|
buf[i] = abc[rand() % (sizeof(abc) - 1)];
|
||||||
|
|
||||||
buf[cfg.name_len] = '\n';
|
buf[cfg.name_len] = '\0';
|
||||||
buf[cfg.name_len + 1] = '\0';
|
|
||||||
|
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
if (stat(buf, &sb) < 0)
|
if (stat(buf, &sb) < 0)
|
||||||
return 1;
|
return 0;
|
||||||
|
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -147,7 +146,8 @@ void upload(CLIENT_THREAD *CT) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (send(CT->fd, CT->filename, strlen(CT->filename), 0) < 0)
|
send(CT->fd, CT->filename, strlen(CT->filename), 0);
|
||||||
|
if (send(CT->fd, "\n", 1, 0) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Create file */
|
/* Create file */
|
||||||
|
Loading…
Reference in New Issue
Block a user