All pastes #753231 Raw Edit

Mine

public text v1 · immutable
#753231 ·published 2007-10-29 01:36 UTC
rendered paste body
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int foo(char *arg)
{
  char buf[128];
  int len, i;

  len = strlen(arg);
  if (len > 136)
    len = 136;
  
  for (i = 0; i <= len; i++)
    buf[i] = arg[i];

  return 0;
}

int main(int argc, char *argv[])
{
  int a = 0;
  int *p = &a;

  if (argc != 2)
    {
      fprintf(stderr, "target7: argc != 2\n");
      exit(EXIT_FAILURE);
    }

  foo(argv[1]);

  *p = a;

  _exit(0);
  /* not reached */
  return 0;
}