Fix UB vector usage
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / resall.cpp
index fac51b47a22947911ab3df0c0b24035a819a98c9..df04c52f831ae06ef0b6a79d19d1633638bca4d7 100644 (file)
@@ -376,7 +376,7 @@ void readResidueDatabase(const std::string &rrdb, std::vector<PreprocessResidue>
         print_resall_header(stderr, gmx::arrayRefFromArray(&header_settings, 1));
     }
     /* We don't know the current size of rrtp, but simply realloc immediately */
-    auto oldArrayEnd = rtpDBEntry->end() - 1;
+    auto oldArrayEnd = rtpDBEntry->end();
     while (!feof(in))
     {
         /* Initialise rtp entry structure */