[PATCH 2/2] use correct type for sizeof

Jamie Couture jamie.couture at gmail.com
Thu Jan 12 04:38:49 CET 2012


**L would have worked well too.  Depending on the distribution sizeof *L
may return 8 instead of 4. **L is preferable, but since we don't expect
this datatype to change very often, sizeof int is less subtle and easier
to understand.

Signed-off-by: Jamie Couture <jamie.couture at gmail.com>
---
 ui-ssdiff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ui-ssdiff.c b/ui-ssdiff.c
index 45770b1..0cff4b8 100644
--- a/ui-ssdiff.c
+++ b/ui-ssdiff.c
@@ -23,7 +23,7 @@ static void create_or_reset_lcs_table()
 	int i;
 
 	if (L != NULL) {
-		memset(*L, 0, sizeof(*L) * MAX_SSDIFF_SIZE);
+		memset(*L, 0, sizeof(int) * MAX_SSDIFF_SIZE);
 		return;
 	}
 
-- 
1.7.7.4





More information about the CGit mailing list