This commit is contained in:
wt committed 2023-03-13 12:06:14 +07:00
1 parent d2d8922029
commit a92b69a6f5
2 files changed
+7 -8

No files matched your search

+3 -3
View File
@@ -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)
+4 -5
View File
@@ -1,11 +1,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/stat.h>
#include <sys/types.h>
// #include <sys/stat.h>
// #include <sys/types.h>
// #include <unistd.h>
#include <fcntl.h>
#include <stdint.h>
// #include <fcntl.h>
// #include <stdint.h>
#include <string.h>
#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++) {