summaryrefslogtreecommitdiff
path: root/tests/test_fread_overwrite_static.c
blob: 2710d24b1a9aeae4bf336030300c2f045d5b1edb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <assert.h>

#include "common.h"

#include <stdio.h>

int main(int argc, char** argv) {
  char buffer[12] = {0};

  assert(sizeof(buffer - 2) * 10 > sizeof(buffer));

  CHK_FAIL_START
  fread(buffer, sizeof(buffer) - 2, 10, NULL);
  CHK_FAIL_END

  puts(buffer);
  return ret;
}