code: def null_term(str):
      '''null terminate a string'''
      idx = str.find("\0")
      if idx != -1:
          str = str[:idx]
      return stf null_term(str):
      '''null terminate a string'''
      idx = str.find("\0")
      if idx != -1:
          str = str[:idx]
      return str
docs: null terminate a string