Skip to content

Commit 7b6ca4e

Browse files
committed
Fix format string in template
1 parent adbf4f5 commit 7b6ca4e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

nxc/protocols/smb.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,14 +1003,14 @@ def qwinsta(self):
10031003
maxStateLen = max(len(sessions[i]["state"]) + 1 for i in sessions)
10041004
maxStateLen = max(maxStateLen, len("STATE") + 1)
10051005

1006-
template = ("{SESSIONNAME: <%d} "
1007-
"{USERNAME: <%d} "
1008-
"{ID: <%d} "
1006+
template = (f"{{SESSIONNAME: <{maxSessionNameLen}}} "
1007+
f"{{USERNAME: <{maxUsernameLen}}} "
1008+
f"{{ID: <{maxIdLen}}} "
10091009
"{IPv4: <16} "
1010-
"{STATE: <%d} "
1010+
f"{{STATE: <{maxStateLen}}} "
10111011
"{DSTATE: <9} "
10121012
"{CONNTIME: <20} "
1013-
"{DISCTIME: <20} ") % (maxSessionNameLen, maxUsernameLen, maxIdLen, maxStateLen)
1013+
"{DISCTIME: <20} ")
10141014

10151015
header = template.format(
10161016
SESSIONNAME="SESSIONNAME",

0 commit comments

Comments
 (0)