tinyos / nesc

Master nesc repository
GNU General Public License v2.0
100 stars 53 forks source link

Bug in mig's python class generation #39

Closed Cecs87 closed 6 years ago

Cecs87 commented 7 years ago

When an array of uint8_t or int8t is considered as a String in Python, the method setString$pythonfield adds a trailing 0 to terminate the string. The method getString_$pythonfield should check every array element against 0, to recognize the end of the string. But on line 383 the test is against chr(0), a string. Moreover, on line 385 the method adds a number to the output string.

Therefore I moved the chr() function call from line 383 to line 385 so that the method looks for the actual end of the string and it adds a character to the output string.