Skip to content

Instantly share code, notes, and snippets.

@adrianparvino
Created April 29, 2018 03:30
Show Gist options
  • Save adrianparvino/e355b91daac5728b3baf86bbbf69b700 to your computer and use it in GitHub Desktop.
Save adrianparvino/e355b91daac5728b3baf86bbbf69b700 to your computer and use it in GitHub Desktop.
#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