Permalink
Browse files

Fixed old bug that caused improper .pfd files when folding time series

  • Loading branch information...
1 parent a81394c commit d6ae0599a4e0f7d8e228e084393c016927895fa2 @scottransom committed Feb 24, 2014
Showing with 4 additions and 28 deletions.
  1. +4 −28 src/prepfold_utils.c
View
@@ -610,34 +610,10 @@ void read_prepfoldinfo(prepfoldinfo * in, char *filename)
itmp = read_int(infile, byteswap);
in->pgdev = calloc(itmp + 1, sizeof(char));
chkfread(in->pgdev, sizeof(char), itmp, infile);
- {
- int has_posn = 1, ii;
- chkfread(temp, sizeof(char), 16, infile);
- /* Check to see if a position string was written */
- for (ii = 0; ii < 16; ii++) {
- if (!isdigit(temp[ii]) &&
- temp[ii] != ':' &&
- temp[ii] != '.' && temp[ii] != '-' && temp[ii] != '\0') {
- has_posn = 0;
- break;
- }
- }
- if (has_posn) {
- strcpy(in->rastr, temp);
- chkfread(in->decstr, sizeof(char), 16, infile);
- in->dt = read_double(infile, byteswap);
- in->startT = read_double(infile, byteswap);
- } else {
- strcpy(in->rastr, "Unknown");
- strcpy(in->decstr, "Unknown");
- in->dt = *(double *) (temp + 0);
- if (byteswap)
- in->dt = swap_double(in->dt);
- in->startT = *(double *) (temp + sizeof(double));
- if (byteswap)
- in->startT = swap_double(in->startT);
- }
- }
+ chkfread(in->rastr, sizeof(char), 16, infile);
+ chkfread(in->decstr, sizeof(char), 16, infile);
+ in->dt = read_double(infile, byteswap);
+ in->startT = read_double(infile, byteswap);
in->endT = read_double(infile, byteswap);
in->tepoch = read_double(infile, byteswap);
in->bepoch = read_double(infile, byteswap);

0 comments on commit d6ae059

Please sign in to comment.