Commit c9250c0
committed
coverity: Fix Sizeof not portable (SIZEOF_MISMATCH)
Coverity reports that passing argument 'sizeof (ctx->attrs)' to calloc and
then casting the return value to 'char **' looks suspicious. In fact, this
is just plain wrong. It happens to work, in this particular case since
sizeof (char ** const) happens to be equal to sizeof (char *), but this is
not a portable assumption.
So fix that by using 'sizeof (*ctx->attrs)'
Signed-off-by: Robin Getz <robin.getz@analog.com>1 parent 58f3017 commit c9250c0
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
0 commit comments