#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
  int i;
#if defined(UNSAFE)
#define LEN 16
  char str[LEN], *buf = NULL;

  strcpy(str, "0123456789abcdef");
  buf = malloc(strlen(str));
  if (buf) {
    for (i=1; i<=LEN; i++)
      buf[i] = str[i];
    buf[i] = '\0';
  }
  puts(buf);
  for (i=0; i<=argc; i++)
    puts(argv[i]);
#else
  char str[16], *buf = NULL;

  strncpy(str, "0123456789abcdef", sizeof(str)-1);
  str[sizeof(str)-1] = '\0';
  buf = malloc(strlen(str)+1);
  if (buf) {
    for (i=0; i<sizeof(str)-1; i++)
      buf[i] = str[i];
    buf[i] = '\0';
  }
  puts(buf);
  for (i=0; i<argc; i++)
    puts(argv[i]);
#endif
  return 0;
}
