chiark / gitweb /
Remove a redundant and also erroneous memset.
authorSimon Tatham <anakin@pobox.com>
Mon, 11 Mar 2013 19:58:28 +0000 (19:58 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 11 Mar 2013 19:58:28 +0000 (19:58 +0000)
(If you're going to memset a struct to 0 before filling in the fields
you care about, do use sizeof the struct rather than sizeof the
pointer; but also, if you're filling in _every_ field, there's no need
to bother anyway.)

[originally from svn r9773]

lightup.c

index 5beacc71b09fbc860935953dfb43d8c876467432..9131428313dc4f95c01b2216a12a9a0e5e5819d9 100644 (file)
--- a/lightup.c
+++ b/lightup.c
@@ -657,7 +657,6 @@ static void list_lights(game_state *state, int ox, int oy, int origin,
 {
     int x,y;
 
-    memset(lld, 0, sizeof(lld));
     lld->ox = lld->minx = lld->maxx = ox;
     lld->oy = lld->miny = lld->maxy = oy;
     lld->include_origin = origin;