1
0
mirror of https://gittea.dev/nova/th.git synced 2025-10-21 18:30:15 -04:00

removal of rand() in sort_rand

This commit is contained in:
nova
2025-10-05 00:57:18 +02:00
parent e979209de3
commit f0ad6295f7
3 changed files with 27 additions and 10 deletions

View File

@@ -2,6 +2,7 @@
#include <pthread.h>
#include <dirent.h>
#include <string.h>
#include <unistd.h>
#include "file_previews.h"
#include "backend.h"
@@ -36,7 +37,7 @@ extern unsigned int status;
extern char *start_path;
extern char *input;
extern time_t seed;
extern time_t *seed;
char search_buffer[255];
unsigned int timeout_time = 0;
@@ -633,8 +634,10 @@ void jump_to_dir(int passes, int index){
void order_by(int passes, int index){
(void)passes;
seed = time(NULL);
srand(seed);
free(seed);
seed = malloc(sizeof(time_t));
*seed = time(NULL);
order_func = key_binding[index].black_magic;
status |= (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_MASK | STATUS_RELOAD_DIRECTORY);
}