From a36652959e52e8c810b7d2d76a283b2ae9718d96 Mon Sep 17 00:00:00 2001 From: epochqwert Date: Thu, 23 Apr 2015 04:53:35 -0500 Subject: elapsedtime handles partial seconds better unescape now handles multiple lines from stdin clump can now have an optional argument to specify input separator cuturl can now take compressed short options. (like: cuturl -dPs) filemon... I don't remember. just reformatted it looks like. ipconvert. looks like I added explainations before output. normalpath now uses getenv("PWD") instead of getcwd() so you can pick what you want to be the base for relative paths. urcdump... nothing I guess. probably a space or something dumb. httpd... more environment variables set for CGIs --- src/bin/urcdump.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'src/bin/urcdump.c') diff --git a/src/bin/urcdump.c b/src/bin/urcdump.c index 8d19370..0fea8ed 100644 --- a/src/bin/urcdump.c +++ b/src/bin/urcdump.c @@ -7,7 +7,8 @@ int main(int argc,char *argv[]) { int s; struct sockaddr_in name; - char *tmp; + //char *tmp; + int tmp; char chunk[BS]; int off=0; char buf[BS]; @@ -25,15 +26,34 @@ int main(int argc,char *argv[]) { if(connect(s,(struct sockaddr *)&name,len) == -1) return -1; while((len=read(s,buf,BS-1)) > 0) { - memcpy(chunk+off,buf,len); - off+=len; - if(off > 26) { + for(tmp=0;tmp>4&15),1); + write(1,"0123456789abcdef"+((buf[tmp])&15),1); + } + } +/* + while(off > 26) { if((tmp=memchr(chunk+26,'\n',off-26))) { tmp++; - write(1,chunk+26,tmp-chunk-26); +//old write(1,chunk+26,tmp-chunk-26); +//testing: + for(len=26;len>4 & 15),1); + write(1,"0123456789abcdef"+((*chunk+len)&15),1); + } + } memmove(chunk,tmp,tmp-chunk+1); off-=(tmp-chunk); } } + */ } } -- cgit v1.2.3