From: nishi Date: Fri, 26 Jan 2024 05:48:10 +0000 (+0000) Subject: segfault fix X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=bd32ba7eec8731cc1f57126d1f3b4212e8289391;p=libw3.git segfault fix git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@84 d27a3e52-49c5-7645-884c-6793ebffc270 --- diff --git a/Example/W3B/Makefile b/Example/W3B/Makefile index 8b1f4e2..e811bca 100644 --- a/Example/W3B/Makefile +++ b/Example/W3B/Makefile @@ -2,10 +2,10 @@ .PHONY: clean install ./w3b: ./w3b.o $(RESFILE) - $(CC) -o $@ -L ../../Library $^ -lw3 + $(CC) -g -o $@ -L ../../Library $^ -lw3 ./%.o: ./%.c - $(CC) -c -o $@ -I ../../Library $< + $(CC) -g -c -o $@ -I ../../Library $< ../libw3.res: $(MAKE) -C .. ./libw3.res WINDRES=$(WINDRES) diff --git a/Example/W3B/w3b.c b/Example/W3B/w3b.c index 258b0a8..120bd49 100644 --- a/Example/W3B/w3b.c +++ b/Example/W3B/w3b.c @@ -68,7 +68,9 @@ int main(int argc, char** argv) { } while(true) { /* Loop */ if(c != '\n' && c != '\r') { - printf("(O)pen, (Q)uit? "); + printf("(O)pen, (Q)uit"); + if(acc) printf(", (P)rint all"); + printf("? "); fflush(stdout); } if(scanf("%c", &c) < 0) break; @@ -83,6 +85,10 @@ int main(int argc, char** argv) { scanf("%s", url); acc = false; break; + case 'p': + if(acc){ + } + break; case '\n': case '\r': break; @@ -90,7 +96,7 @@ int main(int argc, char** argv) { printf("What do you mean?\n"); break; } - if(!acc) { + if(!acc && url != NULL) { access_site(url); acc = true; } diff --git a/Example/fetch/Makefile b/Example/fetch/Makefile index fdbaaec..3de3103 100644 --- a/Example/fetch/Makefile +++ b/Example/fetch/Makefile @@ -2,7 +2,7 @@ .PHONY: clean install ./fetch: ./fetch.c $(RESFILE) - $(CC) -o $@ -I ../../Library -L ../../Library $^ -lw3 + $(CC) -g -o $@ -I ../../Library -L ../../Library $^ -lw3 ../libw3.res: $(MAKE) -C .. ./libw3.res WINDRES=$(WINDRES)