--- psp.c	2009-09-13 22:26:53.000000000 -0700
+++ /net/noble/vol1/home/cegrant/psp.c	2010-04-26 16:28:29.000000000 -0700
@@ -257,6 +257,8 @@
     int length = sample->length;		// sequence length
     int new_m = length-new_w+1;			// number of possible new positions
 
+   if (new_m < 1) continue;                    // skip sequence too short for motif
+
     // compute log_psp for this sequence
     if (psp_original == NULL) {			// Create a uniform prior.
       int ns = revcomp ? 2*new_m : new_m;	// possible sites on 1 or 2 strands
@@ -635,4 +637,3 @@
     }
   return TRUE;
 } /* all_zeros */
-
