-
Notifications
You must be signed in to change notification settings - Fork 0
/
stringtest.c
35 lines (32 loc) · 835 Bytes
/
stringtest.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
/*
* Authors: LOPES Marco, ISELI Cyril and RINGOT Gaëtan
* Purpose: Password cracker.
* Language: C
* Date : 2 november 2016
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "string.h"
/*
* Print the password, and the time elapsed to find it
*
* argc: argument counter
* argv: table of arguments
*
* returns: EXIT_FAILURE or EXIT_SUCCESS.
*/
int main(int argc, char const *argv[]) {
char *string = malloc(sizeof(char) * 20);
char *string2 = malloc(sizeof(char) * 20);
for (unsigned int i = 0; i < 1000; ++i) {
string[0] = '0';
string[1] = '\0';
string2[0] = '0';
string2[1] = '\0';
if(strcmp(jumpToAlphabetRelative(i, string), jumpToAlphabet(i+1, string2)) != 0){
printf("error");
}
}
return EXIT_SUCCESS;
}