summaryrefslogtreecommitdiff
path: root/x11/habak/files/patch-src_random.c
blob: bfb07973dd4bfc5ff2740349b9609d187228012b (plain) (blame)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
--- src/random.c.orig	2004-12-09 17:01:43 UTC
+++ src/random.c
@@ -13,7 +13,7 @@ int syserr;
 
 #define ALLOC_STEP 1000
 regex_t regexp;
-int size_files=0, used_files=0, i=0;
+int size_files=0, used_files=0;
 char **files, *wyjscie;
 regmatch_t matchpos;
 
@@ -70,9 +70,9 @@ return;
 
 char *randomly_select_font(const char *wejscie){
 
-files=NULL;wyjscie=NULL;size_files=0;used_files=0;i=0;
+files=NULL;wyjscie=NULL;size_files=0;used_files=0;;
 
-regcomp(&regexp,"^.*\\.ttf$",REG_ICASE||REG_NOSUB);
+regcomp(&regexp,"^.*\\.ttf$",REG_ICASE|REG_NOSUB);
 
 add_file(wejscie);
 
@@ -80,7 +80,7 @@ if (used_files==0) {
 	return NULL;
 }
 
-i=rand()%used_files;
+int i=rand()%used_files;
 wyjscie=malloc(strlen(files[i])+1);
 strcpy(wyjscie,files[i]);
 
@@ -92,9 +92,9 @@ return wyjscie;
 
 char *randomly_select_image(const char *wejscie){
 
-files=NULL;wyjscie=NULL;size_files=0;used_files=0;i=0;
+files=NULL;wyjscie=NULL;size_files=0;used_files=0;;
 
-regcomp(&regexp,"^.*\\.(bmp|jpg|jpeg|png|tiff|tif|tga|gif|pcx|xpm|pnm|ppm|xbm)$",REG_ICASE||REG_NOSUB);
+regcomp(&regexp,"^.*\\.(bmp|jpg|jpeg|png|tiff|tif|tga|gif|pcx|xpm|pnm|ppm|xbm)$",REG_ICASE|REG_NOSUB);
 
 add_file(wejscie);
 
@@ -102,7 +102,7 @@ if (used_files==0) {
 	return NULL;
 }
 
-i=rand()%used_files;
+int i=rand()%used_files;
 wyjscie=malloc(strlen(files[i])+1);
 strcpy(wyjscie,files[i]);