#include <ctype.h>
#include <string.h>
+#include <assert.h>
#include "sysstuff.h"
#include "strdb.h"
#include "futil.h"
void analyse(t_atoms *atoms,t_blocka *gb,char ***gn,gmx_bool bASK,gmx_bool bVerb)
{
- gmx_residuetype_t rt;
+ gmx_residuetype_t rt=NULL;
char *resnm;
atom_id *aid;
const char ** restype;
/* For every residue, get a pointer to the residue type name */
gmx_residuetype_init(&rt);
+ assert(rt);
snew(restype,atoms->nres);
ntypes = 0;
b->index[b->nr]=b->index[b->nr-1];
(*grpname)[b->nr-1]=strdup(str);
} else {
+ if (b->nr==0)
+ {
+ gmx_fatal(FARGS,"The first header of your indexfile is invalid");
+ }
pt=line;
- while ((i=sscanf(pt,"%s",str)) == 1) {
+ while (sscanf(pt,"%s",str) == 1) {
i=b->index[b->nr];
if (i>=maxentries) {
maxentries+=1024;