Skip to content

Commit 9aa73de

Browse files
committed
fix bug in example with uncaught null at the end of msg
1 parent 311b40f commit 9aa73de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/ccs/ccs_server.py

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

33
def handler(msg):
44
print("CCS Ping handler called on " + str(charm.myPe()))
5-
answer = "Hello to sender " + str(msg) + "from PE " + str(charm.myPe())
5+
6+
msg = msg.rstrip('\x00') #removes null characters from the end
7+
answer = "Hello to sender " + str(msg) + " from PE " + str(charm.myPe()) + ".\n"
68
# send the answer back to the client
79
charm.CcsSendReply(answer)
810

0 commit comments

Comments
 (0)