fprintf_unfiltered (serial_logfp, "%02x", ch & 0xff);
fprintf_unfiltered (stream, "%02x", ch & 0xff);
serial_logchar (ch, timeout)     int ch;     int timeout;{  if (serial_logbase != logbase_ascii)    fputc_unfiltered (' ', serial_logfp);  switch (ch)    {    case SERIAL_TIMEOUT:      fprintf_unfiltered (serial_logfp, "<Timeout: %d seconds>", timeout);      return;    case SERIAL_ERROR:      fprintf_unfiltered (serial_logfp, "<Error: %s>", safe_strerror (errno));      return;    case SERIAL_EOF:      fputs_unfiltered ("<Eof>", serial_logfp);      return;    case SERIAL_BREAK:      fputs_unfiltered ("<Break>", serial_logfp);      return;    default:      if (serial_logbase == logbase_hex)	fprintf_unfiltered (serial_logfp, "%02x", ch & 0xff);      else if (serial_logbase == logbase_octal)	fprintf_unfiltered (serial_logfp, "%03o", ch & 0xff);      else	switch (ch)	  {	  case '\\':	fputs_unfiltered ("\\\\", serial_logfp); break;		  case '\b':	fputs_unfiltered ("\\b", serial_logfp); break;		  case '\f':	fputs_unfiltered ("\\f", serial_logfp); break;		  case '\n':	fputs_unfiltered ("\\n", serial_logfp); break;		  case '\r':	fputs_unfiltered ("\\r", serial_logfp); break;		  case '\t':	fputs_unfiltered ("\\t", serial_logfp); break;		  case '\v':	fputs_unfiltered ("\\v", serial_logfp); break;		  default:	fprintf_unfiltered (serial_logfp, isprint (ch) ? "%c" : "\\x%02x", ch & 0xFF); break;	  }	}}