fixed time seed issue

This commit is contained in:
solusipse
2013-09-06 05:03:11 +02:00
parent c1e0d782ed
commit ebe5c33cd6
2 changed files with 3 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ $ cat fiche.c | nc localhost 9999
int main(int argc, char **argv)
{
srand((unsigned int) time(0));
time_seed = time(0);
set_basedir();
parse_parameters(argc, argv);
@@ -156,7 +156,7 @@ void bind_to_port(int listen_socket, struct sockaddr_in server_address)
void generate_url(char *buffer, char *slug)
{
int i, time_seed = time(0);
int i;
memset(slug, '\0', sizeof(slug));
for (i = 0; i <= SLUG_SIZE - 1; i++)

View File

@@ -39,6 +39,7 @@ $ cat fiche.c | nc localhost 9999
#include <sys/socket.h>
#include <netinet/in.h>
int time_seed;
char *BASEDIR;
int PORT = 9999;
int SLUG_SIZE = 4;