diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-09 14:34:09 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-09 14:34:09 -0400 |
| commit | 5ddc56a646721ea20bf83134ad1efe9b4a93cfc9 (patch) | |
| tree | 0fe26a470755f38df42291f237586224467c9991 /ws2a | |
| parent | ff23d46cdd29b23f9e2046e1a3b733040c502b9c (diff) | |
| download | webpage-5ddc56a646721ea20bf83134ad1efe9b4a93cfc9.tar.gz webpage-5ddc56a646721ea20bf83134ad1efe9b4a93cfc9.tar.bz2 webpage-5ddc56a646721ea20bf83134ad1efe9b4a93cfc9.zip | |
More work on bug reporter
Diffstat (limited to 'ws2a')
| -rw-r--r-- | ws2a/bugsdata.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/ws2a/bugsdata.c b/ws2a/bugsdata.c index 4ba3718..498eaf4 100644 --- a/ws2a/bugsdata.c +++ b/ws2a/bugsdata.c @@ -2,10 +2,33 @@ #include <string.h> #include <stdlib.h> #include <stdint.h> +#include "common.c" int main(){ - char* data = getenv("QUERY_STRING"); - char* hardip = getenv("REMOTE_ADDR"); + FILE* lastfilenum; + lastfilenum = fopen("../ws2a/bugs/lastbug","r") + if(lastfilenum == NULL){ + printf("Error reteriveing bugs, contact the admin!") + } + long long last = 0; + fscanf(lastfilenum,"%u",&last); + long long end = last-20; + while(last > end && last > 0){ + char filestring[64]; + strcat(filestring,"../ws2a/bugs/"); + strcat(filestring,itoa(last)); + FILE* thisbug; + thisbug = fopen(filestring,"r"); + if(thisbug == NULL){ + printf("Error opening bug:%d\n",last); + continue; + } + while(!feof(thisbug)){ + putc(fgetc(thisbug)); + } + printf("<br/>"); + last--; + } printf("%s%c%c\n", "Content-Type:text/html;charset=iso-8859-1",13,10); printf("Data:%s",data); |
