Merge branch 'release-4-5-patches' into release-4-6
[alexxy/gromacs.git] / src / tools / gmx_trjconv.c
index 7cce07ce4ac38732d3d5a5b35a70885bf6015446..9d7ed66f5c7fa9a8424018a9296daea8269b8ac6 100644 (file)
@@ -919,7 +919,9 @@ int gmx_trjconv(int argc,char *argv[])
 
         bSubTraj = opt2bSet("-sub",NFILE,fnm);
         if (bSubTraj) {
-            if ((ftp != efXTC) && (ftp != efTRN))
+            if ((ftp != efXTC) && (ftp != efTRR))
+                /* It seems likely that other trajectory file types
+                 * could work here. */
                 gmx_fatal(FARGS,"Can only use the sub option with output file types "
                           "xtc and trr");
             clust = cluster_index(NULL,opt2fn("-sub",NFILE,fnm));
@@ -1539,7 +1541,7 @@ int gmx_trjconv(int argc,char *argv[])
             ffclose(out);
         if (bSubTraj) {
             for(i=0; (i<clust->clust->nr); i++)
-                if (clust_status[i] )
+                if (clust_status_id[i] >= 0 )
                     close_trx(clust_status[i]);
         }
     }