92cdfdab1ced85ac262e907c48d086bb88a431c1 kent Wed Feb 13 14:01:21 2013 -0800 Fixed off by one bug. diff --git src/kehayden/reverseCenReads/reverseCenReads.c src/kehayden/reverseCenReads/reverseCenReads.c index bdca8d0..7c5541e 100644 --- src/kehayden/reverseCenReads/reverseCenReads.c +++ src/kehayden/reverseCenReads/reverseCenReads.c @@ -26,31 +26,31 @@ struct lineFile *lf = lineFileOpen(input, TRUE); FILE *f = mustOpen(output, "w"); char *line; int maxWords = 16; char *words[maxWords]; while (lineFileNext(lf, &line, NULL)) { int wordCount = chopByWhite(line, words, maxWords); if (wordCount >= maxWords) errAbort("Too many words (%d) line %d of %s", wordCount, lf->lineIx, lf->fileName); if (wordCount < 2) errAbort("Need at least 2 words, got %d line %d of %s", wordCount, lf->lineIx, lf->fileName); fprintf(f, "%s", words[0]); /* First word - readId - not reversed. */ int i; - for (i=wordCount-1; i>1; --i) + for (i=wordCount-1; i>=1; --i) fprintf(f, "\t%s", words[i]); fprintf(f, "\n"); } carefulClose(&f); } int main(int argc, char *argv[]) /* Process command line. */ { optionInit(&argc, argv, options); if (argc != 3) usage(); reverseCenReads(argv[1], argv[2]); return 0; }