if (detect_cuda_gpus(&hwinfo_g->gpu_info, detection_error) != 0)
{
- if (detection_error != NULL && detection_error[0] != '\0')
+ if (detection_error[0] != '\0')
{
sprintf(sbuf, ":\n %s\n", detection_error);
}
/* Skip blank or comment-only lines */
do
{
- fgets2(buf, STRLEN, in);
- if (NULL != buf)
+ if (fgets2(buf, STRLEN, in) != NULL)
{
strip_comment(buf);
trim(buf);
}
}
- while (!feof(in) && NULL != buf && strlen(buf) == 0);
+ while (!feof(in) && strlen(buf) == 0);
- if ((buf != NULL) && (sscanf(buf, "%s%lf", name, &m) == 2))
+ if (sscanf(buf, "%s%lf", name, &m) == 2)
{
a->m = m;
add_atomtype(at, tab, a, name, nb, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 );
- fprintf(stderr, "\rAtomtype %d", nratt+1);
+ fprintf(stderr, "\rAtomtype %d", ++nratt);
+ }
+ else
+ {
+ fprintf(stderr, "\nInvalid format: %s\n", buf);
}
}
gmx_ffclose(in);