summaryrefslogtreecommitdiff
path: root/tests/test_stpncpy_static_write.c
blob: d4202ba5ee2e7bfb9378fa15fe718b03a54487b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "common.h"

#include <string.h>

int main(int argc, char** argv) {
  char buffer[8] = {0};
  stpncpy(buffer, "1234567890", 5);
  stpncpy(buffer, "1234567890", 8);
  puts(buffer);

  CHK_FAIL_START
  stpncpy(buffer, "1234567890", 10);
  CHK_FAIL_END

  puts(buffer);
  return ret;
}