Created
April 29, 2018 03:30
-
-
Save adrianparvino/e355b91daac5728b3baf86bbbf69b700 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 <errno.h> | |
#include <limits.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
int main(void) | |
{ | |
char *a; | |
//a = malloc(SIZE_MAX / 2); | |
a = malloc(SIZE_MAX); | |
//char *b = strerror(errno); | |
//write(2, b, strlen(b)); | |
perror("malloc error\n"); | |
a[0] = 'a'; | |
a[1] = '\0'; | |
printf("%s", a); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment