From fafc45b72067ecd17ac154a7c709cbc6b5fd7580 Mon Sep 17 00:00:00 2001 From: AfonsoCMSousa Date: Thu, 27 Feb 2025 20:27:33 +0000 Subject: [PATCH] Fix error where level wasnt define before request. --- src/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 7555223..4682657 100644 --- a/src/main.c +++ b/src/main.c @@ -173,19 +173,20 @@ int main(void) req.type = 0; memset(&req, 0, sizeof(req)); req.ID = 0; - + req.level = 1; send(sockfd, &req, sizeof(Request), 0); // Receive response from the server recv(sockfd, &req, sizeof(req), 0); if (req.level == -1) { - printf("No existing passwords, use \"addpass\" command to add a password to the list.\n"); + printf("No existing passwords with, use \"addpass\" command to add a password to the list.\n"); } else { printf("Level: %d\tKey: %s\n", req.level, req.key); } + printf("<------->\n\n"); choice = prompNormalRequest(">> "); if (strcmp(choice, "exit") == 0 || strcmp(choice, "quit") == 0 || strcmp(choice, "q") == 0)