[dev] [st patch queue 06/12] Avoid integer overflow in dump().

From: noname <noname_AT_inventati.org>
Date: Fri, 25 Apr 2014 18:27:03 +0400

---
 st.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/st.c b/st.c
index dae23c5..9de7f81 100644
--- a/st.c
+++ b/st.c
_AT_@ -1234,8 +1234,10 @@ dump(char c) {
 	static int col;
 
 	fprintf(stderr, " %02x '%c' ", c, isprint(c)?c:'.');
-	if(++col % 10 == 0)
+	if(++col == 10) {
 		fprintf(stderr, "\n");
+		col = 0;
+	}
 }
 
 void
-- 
1.8.4
Received on Fri Apr 25 2014 - 16:27:03 CEST

This archive was generated by hypermail 2.3.0 : Fri Apr 25 2014 - 16:36:25 CEST