-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.c
36 lines (35 loc) · 781 Bytes
/
test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <stdio.h>
#include <stdlib.h>
void testGetFile() {
FILE *fp = fopen("chains", "r");
size_t len = 255;
char *line = malloc(sizeof(char) * len);
if (fp == NULL) {
printf("cant open file!");
return;
}
int riadok = 0; //counter
while(fgets(line, len, fp) != NULL) {
riadok++;
printf("[+]");
printf("%s\n", line);
}
int count = 0;
rewind(fp);
while(fgets(line, len, fp) != NULL) {
count++;
if (count == riadok){
printf("SERVER STORED HASH: ");
printf("%s\n", line);
}
if (count+1 == riadok){
printf("Client HASH: ");
printf("%s\n", line);
}
}
free(line);
}
int main(){
testGetFile();
return 0;
}