Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aikin-vip committed Apr 2, 2022
1 parent 994f4b4 commit 7c42694
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/nanoid.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ char* safe_simple();
char* custom(char alphs[], int size) {
int alph_size = strlen(alphs) - 1;
char *id = (char *) malloc(sizeof(char) * 3);

for( int i = 0; i < size; i++ ) {
int i;
for(i = 0; i < size; i++ ) {
int random_num;
do {
random_num = rand();
Expand Down Expand Up @@ -74,16 +74,16 @@ char* safe_custom(char alphs[], int size) {
return NULL;

fread(buffer, size, 1, rand_src);

for (int i = 0; i < size; ++i) {
int i;
for (i = 0; i < size; ++i) {
sum += buffer[i];
}

free(buffer);

srand(sum);

for (int j = 0; j < size; ++j) {
int j;
for (j = 0; j < size; ++j) {
unsigned int random_num;

do {
Expand Down

0 comments on commit 7c42694

Please sign in to comment.