Skip to content

Commit 2fec1e7

Browse files
chunkeeymcgrof
authored andcommitted
reglib: fix memset usage
gcc-4.8 fails to compile reglib due to: reglib.c:1133:22: error: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to dereference it? [-Werror=sizeof-pointer-memaccess] memset(rd, 0, sizeof(rd)); ^ reglib.c:1155:22: error: argument to ‘sizeof’ in... (same as above) Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
1 parent 0f73f08 commit 2fec1e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

reglib.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ reglib_parse_country_simple(char *line, struct ieee80211_regdomain *rd)
11271127
char alpha2[2];
11281128
int hits;
11291129

1130-
memset(rd, 0, sizeof(rd));
1130+
memset(rd, 0, sizeof(*rd));
11311131
memset(alpha2, 0, sizeof(alpha2));
11321132
memset(dfs_region_alpha, 0, sizeof(dfs_region_alpha));
11331133

@@ -1149,7 +1149,7 @@ static int reglib_parse_country_dfs(char *line, struct ieee80211_regdomain *rd)
11491149
char alpha2[2];
11501150
int hits;
11511151

1152-
memset(rd, 0, sizeof(rd));
1152+
memset(rd, 0, sizeof(*rd));
11531153
memset(alpha2, 0, sizeof(alpha2));
11541154
memset(dfs_region_alpha, 0, sizeof(dfs_region_alpha));
11551155

0 commit comments

Comments
 (0)