title: Cesar Cipher out of bounds in Array
body: <p>Guys i found this caesar cipher code in some site.... But when i run it its showing segmentation fault in online compilers..but in c compiler tat i'm using its showing processor fault... can anyone pls point out the wrong in this code</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  #define caesar(x) rot(13, x)
  #define decaesar(x) rot(13, x)
  #define decrypt_rot(x, y) rot((26-x), y) 
  
  void rot(int c, char *str)
  {
      int l = strlen(str);
      const char *alpha[2] = { "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
  
      int i;
      for (i = 0; i &lt; l; i++)
      {
          if (!isalpha(str[i]))
              continue;
  
          str[i] = alpha[isupper(str[i])][((int)(tolower(str[i])-'a')+c)%26];
      }
  }
  
  int main()
  {
      char str[] = "This is a top secret text message!";
  
      printf("Original: %s\n", str);
      caesar(str);
      printf("Encrypted: %s\n", str);
      decaesar(str);
      printf("Decrypted: %s\n", str);
  
      return 0;
  }
  </code></pre>