Skip to content

Commit

Permalink
wmlunits: Fix issue where the process name becomes "w" instead of "wm…
Browse files Browse the repository at this point in the history
…lunits"

The basic string type in Python 3 is equivalent to a wchar_t array,
which means that the second byte of every ASCII string is always zero,
causing the string to appear truncated after the first character when
calling C library functions that expect a single or multibyte encoding
(e.g. UTF-8). Just using a byte array does the trick to get a proper
single-byte ASCII string.
  • Loading branch information
irydacea committed Aug 14, 2017
1 parent c734f56 commit a4172bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data/tools/wmlunits
Expand Up @@ -559,7 +559,7 @@ if __name__ == '__main__':
try:
import ctypes
libc = ctypes.CDLL("libc.so.6")
libc.prctl(15, "wmlunits", 0, 0, 0)
libc.prctl(15, b"wmlunits", 0, 0, 0)
except: # oh well...
pass

Expand Down

0 comments on commit a4172bd

Please sign in to comment.