Commit ce7d759
committed
mctp-client: fix valid_parse usage
We have a potentially uninit variable here:
../src/mctp-client.c: In function ‘main’:
../src/mctp-client.c:212:14: warning: ‘valid_parse’ may be used uninitialized [-Wmaybe-uninitialized]
212 | bool valid_parse, valid_eid, valid_type;
| ^~~~~~~~~~~
The valid_parse variable is only initialised in the argument iterator,
so checking outside of this loop may miss cases where a subsequent
argument resets it.
Instead, error-out in the same iteration as an invalid parse.
Signed-off-by: Jeremy Kerr <[email protected]>1 parent 6caf08c commit ce7d759
1 file changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
213 | 212 | | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| 238 | + | |
| 239 | + | |
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
| |||
257 | 259 | | |
258 | 260 | | |
259 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
260 | 265 | | |
261 | 266 | | |
262 | | - | |
| 267 | + | |
263 | 268 | | |
264 | 269 | | |
265 | 270 | | |
| |||
0 commit comments