New utility: nscd cache dumper

Andreas Schwab schwab@suse.de
Thu Mar 12 15:36:59 GMT 2020


On Mär 11 2020, DJ Delorie via Libc-alpha wrote:

> +unsigned char *
> +data_string (unsigned char *cp, const char *str, int len)
> +{
> +  int oops = 0;
> +  unsigned char *cpe = cp + len;
> +  printf ("%s", str);
> +  while (len == -1 || cp < cpe)
> +    {
> +      if (isgraph (*cp))
> +	putchar (*cp);
> +      else
> +	printf ("\033[%dm<%02x>\033[0m",
> +		*cp % 6 + 31,
> +		(unsigned char) *cp);

The cast is a no-op.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


More information about the Libc-alpha mailing list