Skip to content
Snippets Groups Projects
Select Git revision
  • master
  • docker
  • feature_readme
3 results

tightvnc-allow-loopback-connections.xcf.gz

Blame
  • Forked from Peter Gerwinski / Online-Werkzeuge
    Source project has a limited visibility.
    loesung-3.c 526 B
    #include <stdio.h>
    
    int read_hex (char c)
    {
      if (c >= '0' && c <= '9')
        return c - '0';
      else if (c >= 'A' && c <= 'F')
        return c - 'A' + 10;
      else if (c >= 'a' && c <= 'f')
        return c - 'a' + 10;
      else
        {
          fprintf (stderr, "invalid hex digit '%c'\n", c);
          return 0;
        }
    }
    
    int main (void)
    {
      char buffer[100];
      fgets (buffer, 100, stdin);
      for (char *p = buffer; p[0] && p[1]; p += 2)
        {
          char c = 16 * read_hex (p[0]) + read_hex (p[1]);
          printf ("%c", c);
        }
      printf ("\n");
    }