diff options
author | epochqwert <epoch@hacking.allowed.org> | 2015-04-30 13:44:16 -0500 |
---|---|---|
committer | epochqwert <epoch@hacking.allowed.org> | 2015-04-30 13:44:16 -0500 |
commit | 9be8e4e8524a1d33390c8b8824a05ef5624e783e (patch) | |
tree | b7c558cebf0eb3037487b05140c19bb06c4bd369 | |
parent | 89b165504c98599839dfb8a8988f27e91db2dba2 (diff) | |
download | misc-9be8e4e8524a1d33390c8b8824a05ef5624e783e.tar.gz misc-9be8e4e8524a1d33390c8b8824a05ef5624e783e.zip |
added comment to rfc for those wanting to mirror RFCs.
incrementing x and y in turn2line was in the wrong spot and caused weird stuff
-rwxr-xr-x | nocompile/bin/rfc | 1 | ||||
-rw-r--r-- | src/bin/turn2line.c | 14 |
2 files changed, 8 insertions, 7 deletions
diff --git a/nocompile/bin/rfc b/nocompile/bin/rfc index 56440ae..45712fc 100755 --- a/nocompile/bin/rfc +++ b/nocompile/bin/rfc @@ -1,4 +1,5 @@ #!/bin/sh +#btw: http://www.ietf.org/mirror-instructions.html RFCPATH=/anarchy/rfc if [ ! -f "${RFCPATH}/rfc$1.txt" ];then echo "RFC file not found... downloading..." diff --git a/src/bin/turn2line.c b/src/bin/turn2line.c index 3dc190a..a5de23c 100644 --- a/src/bin/turn2line.c +++ b/src/bin/turn2line.c @@ -1,16 +1,16 @@ #include <stdio.h> int main(int argc,char *argv[]) { - int in,x=0,dx,y=0,dy,h=0,dh=argc<2?-1:atoi(argv[1]); - for(;(in=fgetc(stdin)) != -1;dh=-1,x+=dx,y+=dy) { - if(dh == -1) { - dh=-4; + int in,x=0,dx,y=0,dy,h=0,dh=argc<2?-4:atoi(argv[1]); + for(;(in=fgetc(stdin)) != -1;dh=-4) { + if(dh == -4) { switch(in) { case'B':dh++;case'm':dh++;case'L':dh++;case'l':dh++; case'F':dh++;case'r':dh++;case'R':dh++;case's':dh++;default:break; } if(dh==-4) continue; } h=(h+8+dh)%8; - dx=(signed char)"\x01\x01\x00\xff\xff\xff\x00\x01"[h%8]; - dy=(signed char)"\x00\x01\x01\x01\x00\xff\xff\xff"[h%8]; - printf("%d %d %d %d\n",x,y,x+dx,y+dy); + printf("%d %d ",x,y); + x+=(signed char)"\x01\x01\x00\xff\xff\xff\x00\x01"[h%8]; + y+=(signed char)"\x00\x01\x01\x01\x00\xff\xff\xff"[h%8]; + printf("%d %d\n",x,y); } } |