Created
April 19, 2018 09:29
-
-
Save bshastry/33e94a91823c19c00dbad9c71b3202c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#define BUF_SIZE 1024 | |
#define TEST_STR "test" | |
void parse(char *buf) { | |
if (strcmp(buf, TEST_STR)) | |
printf("parsed test\n"); | |
} | |
int main() { | |
void *buf = malloc(BUF_SIZE); | |
read(0, buf, BUF_SIZE); | |
parse((char *)buf); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment