summaryrefslogtreecommitdiff
path: root/ws2a/gencaptcha.c
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-05-10 18:49:02 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-05-10 18:49:02 -0400
commitecd2cf4f930853c13c23f5a35bb1a2610bcb54c9 (patch)
treef6122fe8a25c8a2c7dd319d8da2c326c66a4a697 /ws2a/gencaptcha.c
parent2eaa3969ef07cd8c7036c22c05072bdba2001887 (diff)
downloadwebpage-ecd2cf4f930853c13c23f5a35bb1a2610bcb54c9.tar.gz
webpage-ecd2cf4f930853c13c23f5a35bb1a2610bcb54c9.tar.bz2
webpage-ecd2cf4f930853c13c23f5a35bb1a2610bcb54c9.zip
More work on submitting messages to bug view
Diffstat (limited to 'ws2a/gencaptcha.c')
-rw-r--r--ws2a/gencaptcha.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/ws2a/gencaptcha.c b/ws2a/gencaptcha.c
index c21e6ef..7ab063a 100644
--- a/ws2a/gencaptcha.c
+++ b/ws2a/gencaptcha.c
@@ -67,7 +67,7 @@ int main(){
int barraldis1 = rand()%10;
int barraldis2 = rand()%10;
- int arcdis = (rand()%99)+1;
+ int arcdis = (rand()%45)+45;
char command[1024];
unsigned long rhash = hash(randwords);
sprintf(command,"convert -background white -fill black -pointsize 48 label:\"%s\" \"/home/git/wswebpage/ws2a/captchas/%lu.png\"",randwords,rhash);
@@ -76,14 +76,16 @@ int main(){
system(command);
sprintf(command,"convert \"/home/git/wswebpage/ws2a/captchas/%lu.png\" -virtual-pixel White -distort Arc %d \"/home/git/wswebpage/ws2a/captchas/%lu.png\"",rhash,arcdis,rhash);
system(command);
-
+
printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10);
printf("%lu",rhash);
- /*
- char c;
- while((c = fgetc(imgfile)) && !feof(imgfile)){
- printf("char is:something\n",c);
- //putchar(c);
- }
- */
+
+ FILE* tfile;
+ char filepath[100];
+ sprintf(filepath,"/home/git/wswebpage/ws2a/captchas/%s.txt",randwords);
+ tfile = fopen(filepath,"w");
+ fprintf(tfile,rhash);
+ fclose(tfile);
+
+ return 0;
}