This commit is contained in:
Your Name 2024-09-28 17:04:40 +03:00
parent a19419ccae
commit e409d6e7eb

View File

@ -106,14 +106,13 @@ char rand_name(char *buf) {
for (size_t i = 0; i < cfg.name_len; i++)
buf[i] = abc[rand() % (sizeof(abc) - 1)];
buf[cfg.name_len] = '\n';
buf[cfg.name_len + 1] = '\0';
buf[cfg.name_len] = '\0';
struct stat sb;
if (stat(buf, &sb) < 0)
return 1;
return 0;
return 1;
}
return 1;
@ -147,7 +146,8 @@ void upload(CLIENT_THREAD *CT) {
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;
/* Create file */