repo: uritools action: commit revision: path_from: revision_from: 8d981a07f9d3d73cdd0a823a675277dc8526e166: path_to: revision_to:
commit 8d981a07f9d3d73cdd0a823a675277dc8526e166 Author: epochDate: Mon Sep 5 03:25:55 2022 -0500 urifromline was crashing when being passed argv[1] directly diff --git a/urigetline.c b/urigetline.c
--- a/urigetline.c +++ b/urigetline.c @@ -1,6 +1,8 @@ +#define _XOPEN_SOURCE 500 #include "uri.h" #include#include + #include #include @@ -60,7 +62,7 @@ int main(int argc,char *argv[]) {//argument needs to be the URI free(u); return 1; } - urifromline(u,argv[1]);//only argv[1] is a URI? + urifromline(u,strdup(argv[1])); for(;fgets(line,LINE_LENGTH-1,stdin);) {//each line comes from the config. we need to split it on spaces. if(strchr(line,'\r')) *strchr(line,'\r')=0; if(strchr(line,'\n')) *strchr(line,'\n')=0;
-----END OF PAGE-----