X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Fliburi.so_src%2Fmain.c;h=a9f2e1757aa6b231ceac40c78eace3072b5c1b84;hb=b806b8f55067584cb90fe20277235369a1111c66;hp=e8f8dea0f98f67205c7cbcc8155b4d3dcc2d0b97;hpb=52fad670ab81459de0ff1bd0fa99a3396a6999e3;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/liburi.so_src/main.c b/Usermode/Libraries/liburi.so_src/main.c index e8f8dea0..a9f2e175 100644 --- a/Usermode/Libraries/liburi.so_src/main.c +++ b/Usermode/Libraries/liburi.so_src/main.c @@ -63,7 +63,7 @@ tURI *URI_Parse(const char *String) { int hostlen, portlen, pathlen; tmp += 3; // Eat '://' - ret = malloc(sizeof(tURI) + strlen(String) - 2); + ret = malloc(sizeof(tURI) + protolen + 1 + strlen(tmp) + 1); ret->Proto = (char*)ret + sizeof(tURI); memcpy(ret->Proto, String, protolen); @@ -140,14 +140,8 @@ tURI *URI_Parse(const char *String) else ret->Path = ret->Host + hostlen + 1; - tmp ++; pathlen = 0; - while(*tmp) - { - ret->Path[pathlen] = *tmp; - tmp ++; - pathlen ++; - } + strcpy(ret->Path, tmp); return ret; }