--- radioclk-1.0.ds1.orig/radioclkd.c
+++ radioclk-1.0.ds1/radioclkd.c
@@ -211,6 +211,8 @@
 	for (bits=0,timep=1;timep>0;bits++,timep<<=1)
 		;
 
+        if (bits > 48) bits = 48;
+
 	/* if time_t is signed, 0 is the median value else 1<<bits is median */
 	timep = (timep<0) ? 0 : ((time_t) 1<<bits);
 
@@ -636,7 +638,7 @@
 	}
 
 	/* now sort them into order */
-	qsort(timediff, 59, sizeof(long), TimeCompare);
+	qsort(timediff, 59, sizeof(int), TimeCompare);
 
 	/* calculate the arithmetic mean of the middle half */
 	count = 0;
