repo: uritools
action: commit
revision: 
path_from: 
revision_from: 8d981a07f9d3d73cdd0a823a675277dc8526e166:
path_to: 
revision_to: 
git.thebackupbox.net
uritools
git clone git://git.thebackupbox.net/uritools
commit 8d981a07f9d3d73cdd0a823a675277dc8526e166
Author: epoch 
Date:   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
index 4963a845dce8b083b37ef4173022bb089dc784c7..
index ..eb8ab6b7fe7df3102404da90e2d37dcbca57af90 100644
--- 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-----