diff options
author | epochqwert <epoch@hacking.allowed.org> | 2015-06-28 00:15:29 -0500 |
---|---|---|
committer | epochqwert <epoch@hacking.allowed.org> | 2015-06-28 00:15:29 -0500 |
commit | 976c801cbe9ae8d03cae529b57a10cbb588fd92a (patch) | |
tree | 8c8a64ed504ec8abde678ddd10ab07d9536f3c50 /src/bin/urcdump.c | |
parent | 5581f63df9034370cff54aeda44b365439b141fb (diff) | |
download | misc-976c801cbe9ae8d03cae529b57a10cbb588fd92a.tar.gz misc-976c801cbe9ae8d03cae529b57a10cbb588fd92a.zip |
fixed up a lot of warnings. added watch.
Diffstat (limited to 'src/bin/urcdump.c')
-rw-r--r-- | src/bin/urcdump.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/bin/urcdump.c b/src/bin/urcdump.c index 0fea8ed..f848384 100644 --- a/src/bin/urcdump.c +++ b/src/bin/urcdump.c @@ -1,6 +1,11 @@ +#include <string.h> #include <stdio.h> #include <sys/socket.h> #include <netinet/in.h> +#include <arpa/inet.h> +#include <stdlib.h> +#include <ctype.h> +#include <unistd.h> #define BS 4096 @@ -9,8 +14,8 @@ int main(int argc,char *argv[]) { struct sockaddr_in name; //char *tmp; int tmp; - char chunk[BS]; - int off=0; + //char chunk[BS]; + //int off=0; char buf[BS]; int len=sizeof(struct sockaddr_in); if(argc < 3) { @@ -27,7 +32,7 @@ int main(int argc,char *argv[]) { while((len=read(s,buf,BS-1)) > 0) { for(tmp=0;tmp<len;tmp++) { - if(isprint(*(buf+tmp))) { + if(isprint((short)*(buf+tmp))) { write(1,(buf+tmp),1); } else { write(1,"%",1); @@ -56,4 +61,5 @@ int main(int argc,char *argv[]) { } */ } + return 0; } |