def nts(s):
 p = s.find('\x00')
 if (p == (-1)):
  return s
 return s[:p]

def nts ( s ) : p = s . find ( '\x00' ) if ( p == ( - 1 ) ) : return s return s [ : p ]
convert a null-terminated string field to a python string .