title: GDBM sequential access: bug?
body: <p>I implemented the following GBDM example:</p>
  
  <pre><code>#include &lt;boost/lexical_cast.hpp&gt;
  #include &lt;gdbm.h&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;string.h&gt;
  
  struct record
  {
      int a;
      int b;
  };
  
  int main(int argc, char* argv[])
  {
      GDBM_FILE db;
  
      db = gdbm_open("gdbm.db", 512, GDBM_WRCREAT | GDBM_NOLOCK | GDBM_SYNC, 0664, NULL);
  
      datum lekey;
      datum levalue;
      for (int i = 0; i &lt; 10; ++i) {
          record r;
          r.a = i;
          r.b = i + 1;
          lekey.dptr = (char*) boost::lexical_cast&lt;std::string&gt;(i).c_str();
          lekey.dsize = strlen(lekey.dptr) + 1;
          levalue.dptr = (char*) &amp;r;
          levalue.dsize = sizeof(record);
          gdbm_store(db, lekey, levalue, GDBM_INSERT);
      }
      gdbm_sync(db);
  
      for(lekey = gdbm_firstkey(db);
          lekey.dptr != NULL;
          lekey = gdbm_nextkey(db, lekey)) {
          levalue = gdbm_fetch(db, lekey);
          record* r = (record*) levalue.dptr;
          if (r) {
              std::cout &lt;&lt; lekey.dptr &lt;&lt; " " &lt;&lt; r-&gt;a &lt;&lt; " " &lt;&lt; r-&gt;b &lt;&lt; std::endl;
              free(levalue.dptr);
          }
      }
  
      gdbm_close(db);
  
      return 0;
  }
  </code></pre>
  
  <p>The output is the following:</p>
  
  <pre><code>$ ./gdbm_example 
  3 3 4
  6 6 7
  2 2 3
  9 9 10
  5 5 6
  1 1 2
  8 8 9
  4 4 5
  </code></pre>
  
  <p>Why would <code>0 0 1</code> and <code>7 7 8</code> be left out? Is this a bug or am I doing something wrong?</p>