title: CodeEval Submission, program works on my computer but not when I submit it. C
body: <p>I am doing the fizz buzz challenge in C on CodeEval. It works fine on my computer but when I go to submit on CodeEval I get a failure and a 0 score. It says I have a buffer overflow error but it runs fine on my computer and is producing the exact output that the challenge is requesting.</p>
  
  <pre><code>/*Program Written and Designed by Ryan Sharpe*/
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  void* printNumbers(int A, int B, int max)
  {
    char* num = (char*)calloc(2, sizeof(char));
    int i = 1;
    while(i &lt; max+1)
    {
      if(i % A == 0 &amp;&amp; i % B &gt; 0)
        strcpy(num,"F");
      else if(i % B == 0 &amp;&amp; i % A &gt; 0)
        strcpy(num,"B");
      else if(i % A == 0 &amp;&amp; i % B == 0)
        strcpy(num,"FB");
      else
        strcpy(num,"X");
  
      if(strncmp(num,"X", 2) == 0)
        printf("%d%s", i, " ");
      else
        printf("%s%s", num, " "); 
      i++;   
    }
    printf("\n");
    free(num);
    return 0; 
  }
  
  int main(int argc, char** argv)
  {
    FILE* f;
    f = fopen(argv[1], "r");
    int A, B, max;
    while(fscanf(f,"%d%d%d", &amp;A, &amp;B, &amp;max) != EOF)
      printNumbers(A, B, max);
    fclose(f); 
    return 0;
  }
  </code></pre>
  
  <p>The error that CodeEval is giving is this: Which is something that I did not get running my program:</p>
  
  <pre><code>* buffer overflow detected *: /binary terminated ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7ff699aad807] /lib/x86_64-linux-gnu/libc.so.6(+0x109700)[0x7ff699aac700] /binary[0x4007a0] /binary[0x400857] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7ff6999c476d] /binary[0x400639] ======= Memory map: ======== 00400000-00401000 r-xp 00000000 ca:01 1334 /binary 00600000-00601000 r--p 00000000 ca:01 1334 /binary 00601000-00602000 rw-p 00001000 ca:01 1334
  /binary 018c3000-018e4000 rw-p 00000000 00:00 0
  [heap] 7ff69978d000-7ff6997a2000 r-xp 00000000 ca:01 134950
  /lib/x86_64-linux-gnu/libgcc_s.so.1 7ff6997a2000-7ff6999a1000 ---p 00015000 ca:01 134950
  /lib/x86_64-linux-gnu/libgcc_s.so.1 7ff6999a1000-7ff6999a2000 r--p 00014000 ca:01 134950
  /lib/x86_64-linux-gnu/libgcc_s.so.1 7ff6999a2000-7ff6999a3000 rw-p 00015000 ca:01 134950
  /lib/x86_64-linux-gnu/libgcc_s.so.1 7ff6999a3000-7ff699b58000 r-xp 00000000 ca:01 134939
  /lib/x86_64-linux-gnu/libc-2.15.so 7ff699b58000-7ff699d57000 ---p 001b5000 ca:01 134939
  /lib/x86_64-linux-gnu/libc-2.15.so 7ff699d57000-7ff699d5b000 r--p 001b4000 ca:01 134939
  /lib/x86_64-linux-gnu/libc-2.15.so 7ff699d5b000-7ff699d5d000 rw-p 001b8000 ca:01 134939
  /lib/x86_64-linux-gnu/libc-2.15.so 7ff699d5d000-7ff699d62000 rw-p 00000000 00:00 0 7ff699d62000-7ff699d84000 r-xp 00000000 ca:01 134929 /lib/x86_64-linux-gnu/ld-2.15.so 7ff699f6c000-7ff699f6f000 rw-p 00000000 00:00 0 7ff699f7f000-7ff699f84000 rw-p 00000000 00:00 0 7ff699f84000-7ff699f85000 r--p 00022000 ca:01 134929
  /lib/x86_64-linux-gnu/ld-2.15.so 7ff699f85000-7ff699f87000 rw-p 00023000 ca:01 134929
  /lib/x86_64-linux-gnu/ld-2.15.so 7fff5e021000-7fff5e042000 rw-p 00000000 00:00 0 [stack] 7fff5e1ff000-7fff5e200000 r-xp 00000000 00:00 0
  [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0
  [vsyscall]
  </code></pre>