Another attempt at fixing the segmentation fault previously created.
This commit is contained in:
parent
f5740ec35f
commit
328ad3e832
@ -82,7 +82,7 @@ int main(void)
|
|||||||
printf("Client connected\n");
|
printf("Client connected\n");
|
||||||
|
|
||||||
Request req;
|
Request req;
|
||||||
int n = recv(connfd, &req, sizeof(Request), 0);
|
int n = recv(connfd, &req, sizeof(req), 0);
|
||||||
if (n <= 0)
|
if (n <= 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Client disconnected\n");
|
fprintf(stderr, "Client disconnected\n");
|
||||||
@ -111,8 +111,7 @@ int main(void)
|
|||||||
}
|
}
|
||||||
else if (req.type == 1)
|
else if (req.type == 1)
|
||||||
{
|
{
|
||||||
char *filepath = create(char);
|
char filepath[256];
|
||||||
filepath = size(filepath, 256);
|
|
||||||
|
|
||||||
sprintf(filepath, "%s%d.bin", PASSWORDS, req.level);
|
sprintf(filepath, "%s%d.bin", PASSWORDS, req.level);
|
||||||
|
|
||||||
@ -123,7 +122,6 @@ int main(void)
|
|||||||
writel(filepath, key2, 256);
|
writel(filepath, key2, 256);
|
||||||
|
|
||||||
free(key2);
|
free(key2);
|
||||||
free(filepath);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user