fixed time seed issue - fiche - A pastebin adjusted for gopher use
(HTM) git clone git://vernunftzentrum.de/fiche.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit ebe5c33cd626dfc9a09e608707f1db5cab8a84f1
(DIR) parent c1e0d782ed0e1abed028122e08a8adde09edbcd4
(HTM) Author: solusipse <solus1ps3@gmail.com>
Date: Fri, 6 Sep 2013 05:03:11 +0200
fixed time seed issue
Diffstat:
fiche.c | 4 ++--
fiche.h | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/fiche.c b/fiche.c
@@ -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++)
(DIR) diff --git a/fiche.h b/fiche.h
@@ -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;