title: Why is printf causing a segmentation fault?
body: <p>I have this code:</p>
  
  <pre><code>char* env;
  
  if (getenv("MP") == NULL)
  {
      env = "/usr";
  }
  else
  {
      env = getenv("MP");
  }
  
  printf("($MP is %s)\n", env);
  printf("The program seg faults without printing me :(");
  </code></pre>
  
  <p>The program appears to seg fault after the first print if the $MP environmental variable is not set. If it is set, there is no seg fault and everything works fine.</p>