Skip to content

Commit

Permalink
Merge pull request #119 from zachriggle/cyclic-newline-fix
Browse files Browse the repository at this point in the history
Cyclic should only emit a newline when writing to a TTY
  • Loading branch information
IdolfHatler committed Sep 17, 2014
2 parents 1183fe4 + 6ff0fe8 commit e37b606
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/cyclic
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python2
import argparse, string
import argparse, string, sys
from pwnlib.util import cyclic, packing
from pwnlib import log

Expand Down Expand Up @@ -67,4 +67,8 @@ else:
got = len(result)
if got < want:
log.failure("Alphabet too small (max length = %i)" % got)
print result

sys.stdout.write(result)

if sys.stdout.isatty():
sys.stdout.write('\n')

0 comments on commit e37b606

Please sign in to comment.