[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Tyson Smith <tyson.w.smith@xxxxxxxxx>

---
 interesting-numbers.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/interesting-numbers.c b/interesting-numbers.c
index e77ec80..c0805ab 100644
--- a/interesting-numbers.c
+++ b/interesting-numbers.c
@@ -7,15 +7,14 @@
 static unsigned int plus_minus_two(unsigned int num)
 {
 	/* Now munge it for off-by-ones. */
-	switch (rand() % 5) {
+	switch (rand() % 4) {
 	case 0:	num -= 2;
 		break;
 	case 1:	num -= 1;
 		break;
-	case 2:	return num;
-	case 3:	num += 1;
+	case 2:	num += 1;
 		break;
-	case 4:	num += 2;
+	case 3:	num += 2;
 		break;
 	}
 	return num;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe trinity" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux