[PATCH] Change sprintf to snprintf

From: sin <sin_AT_2f30.org>
Date: Fri, 19 Jul 2013 17:08:15 +0100

cal.c:40: warning: sprintf() is often misused, please use snprintf()
---
 cal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cal.c b/cal.c
index f1ba10d..2c42ccd 100644
--- a/cal.c
+++ b/cal.c
_AT_@ -37,7 +37,7 @@ drawcal(int year, int month, int day, int ncols, int nmons, int fday)
 			cur = moff % 12;
 			yoff = year + moff / 12;
 
-			sprintf(str, "%s %d", smon[cur], yoff);
+			snprintf(str, sizeof(str), "%s %d", smon[cur], yoff);
 			printf("%-20s   ", str);
 			count[i] = 1;
 		}
-- 
1.8.3.3
--CE+1k2dSO48ffgeK--
Received on Mon Sep 17 2001 - 00:00:00 CEST

This archive was generated by hypermail 2.3.0 : Fri Jul 19 2013 - 18:24:02 CEST