mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
plugins/amdgpu: Fix strtoul error handling
Copilot reports a possible false positive error on strtoul conversion due errno not being reset on success. Fix it by clearing errnor prior to the call. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
This commit is contained in:
parent
eca9732519
commit
71be2f42ea
1 changed files with 1 additions and 0 deletions
|
|
@ -334,6 +334,7 @@ static size_t getenv_size_t(const char *var, size_t defvalue)
|
|||
int sh = 0;
|
||||
|
||||
if (value_str) {
|
||||
errno = 0;
|
||||
val = (size_t)strtoul(value_str, &endp, 0);
|
||||
if (errno || value_str == endp) {
|
||||
pr_err("Ignoring invalid value for %s=%s, expecting a positive integer\n", var, value_str);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue