From a92b69a6f5a5b4753397f21d47d7f90be47901a2 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Mon, 13 Mar 2023 12:06:14 +0700 Subject: [PATCH] refactor --- Makefile | 6 +++--- src/main.c | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index fb64e6b..2c9e3a1 100644 --- a/Makefile +++ b/Makefile @@ -3,12 +3,12 @@ CFLAGS = -Wall -std=c17 OUT = pwdgen SRC = src/*.c +build: + @$(CC) $(CFLAGS) $(SRC) -o out/$(OUT) + all: @make build @make run -build: - @$(CC) $(CFLAGS) $(SRC) -o out/$(OUT) - run: @./out/$(OUT) \ No newline at end of file diff --git a/src/main.c b/src/main.c index 7d8e0a5..36d56d5 100644 --- a/src/main.c +++ b/src/main.c @@ -1,11 +1,11 @@ #include #include #include -#include -#include +// #include +// #include // #include -#include -#include +// #include +// #include #include #define ALPHABET "1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM[]{}<>()*#" @@ -15,7 +15,6 @@ "\tpwdgen - generates a four character password from the standard alphabet\n" char *get_random_string(const char *alphabet, int quantity) { - // printf("%s\n%ld\n", alphabet, strlen(alphabet)); srand(time(NULL)); char *str = malloc(sizeof(char*) * quantity); for (int i = 0; i < quantity; i++) {