title: qsort comparator function doesn't order the entire array (leaves 1 element out)
body: <p>Relevant code (index is the size of the array):</p>
  
  <pre><code>typedef struct elemento {
      unsigned long linha;
      unsigned long coluna;
      double valor;
  } elemento; 
  
  elemento Representados[MAXN];
  qsort(Representados, index, sizeof(Representados[0]), lcomparator);
  
  int lcomparator(const void *el1, const void *el2) {
      int l1 = ((elemento *)el1)-&gt;linha;
      int l2 = ((elemento *)el2)-&gt;linha;
      int c1 = ((elemento *)el1)-&gt;coluna;
      int c2 = ((elemento *)el2)-&gt;coluna;
  
      if (l1 &lt; l2) {
          return -1;
      }
      else if (l1 == l2) {
          if (c1 &lt; c2) {
              return -1;
          }
          else if (c1 == c2) {
              return 0;
          }
          else if (c2 &gt; c1) {
              return 1;
          }
      }
      else {
          return 1;
      }
  
  }
  </code></pre>
  
  <p>gcc also prints out the 'control reaches end' warning for lcomparator, but I don't see how it would be possible for my function to not return anything.</p>