Skip to content

Commit b079210

Browse files
committed
Merge branch 'master' of github.com:rocky/python3-trepan
2 parents 668c93b + 11d2af1 commit b079210

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

trepan/inout/tcpfns.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121

2222
def pack_msg(msg):
2323
fmt = '%%0%dd' % LOG_MAX_MSG # A funny way of writing: '%04d'
24-
return bytes(( fmt % len(msg)) + msg, 'UTF-8')
24+
byte_msg = bytes(msg, 'UTF-8')
25+
byte_fmt = bytes(fmt % len(byte_msg), 'UTF-8')
26+
return byte_fmt + byte_msg
2527

2628
def unpack_msg(buf):
2729
if len(buf) == 0:

0 commit comments

Comments
 (0)