Skip to content

Instantly share code, notes, and snippets.

@cablehead
Created June 22, 2017 20:57
Show Gist options
  • Save cablehead/3b1d5470d06d8859377512c31379e5e3 to your computer and use it in GitHub Desktop.
Save cablehead/3b1d5470d06d8859377512c31379e5e3 to your computer and use it in GitHub Desktop.
#include <assert.h>
#include <stdio.h>
#include <unistd.h>
struct packet_t {
char uri[16];
char key[16];
};
int main() {
struct packet_t p;
int n;
n = read(0, &p, sizeof(p));
assert(n == sizeof(p));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment