summaryrefslogtreecommitdiff
path: root/2
diff options
context:
space:
mode:
Diffstat (limited to '2')
-rw-r--r--2/part1.c8
-rw-r--r--2/part2.c6
2 files changed, 7 insertions, 7 deletions
diff --git a/2/part1.c b/2/part1.c
index b7b2f44..3d53cba 100644
--- a/2/part1.c
+++ b/2/part1.c
@@ -3,13 +3,13 @@
#include <stdlib.h>
#include <string.h>
-bool is_valid_password(char * pass, char * policy)
+bool is_valid_password(char *pass, char *policy)
{
int min = atoi(policy);
- char * minP = strchr(policy, '-');
+ char *minP = strchr(policy, '-');
int max = atoi(++minP);
char c = *(strchr(minP, ' ') + 1);
- char * p = pass;
+ char *p = pass;
int occ = 0;
do {
if (*p == c) {
@@ -22,7 +22,7 @@ bool is_valid_password(char * pass, char * policy)
int main()
{
- FILE * file = fopen("input", "r");
+ FILE *file = fopen("input", "r");
char buffer[128] = { 0 };
int valid = 0;
while (fgets(buffer, 128, file)) {
diff --git a/2/part2.c b/2/part2.c
index b856529..b167fcf 100644
--- a/2/part2.c
+++ b/2/part2.c
@@ -3,10 +3,10 @@
#include <stdlib.h>
#include <string.h>
-bool is_valid_password(char * pass, char * policy)
+bool is_valid_password(char *pass, char *policy)
{
int pos1 = atoi(policy) - 1;
- char * minP = strchr(policy, '-');
+ char *minP = strchr(policy, '-');
int pos2 = atoi(++minP) - 1;
char c = *(strchr(minP, ' ') + 1);
@@ -15,7 +15,7 @@ bool is_valid_password(char * pass, char * policy)
int main()
{
- FILE * file = fopen("input", "r");
+ FILE *file = fopen("input", "r");
char buffer[128] = { 0 };
int valid = 0;
while (fgets(buffer, 128, file)) {