mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-04 23:24:56 +00:00
hv: fix type conversion without cast with explicit conversion
Implicit conversion may result in loss of information or undefined behaviour. So make it with explicit conversion. Tracked-On: #861 Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
@@ -90,7 +90,7 @@ long strtol_deci(const char *nptr)
|
||||
break;
|
||||
} else {
|
||||
acc *= base;
|
||||
acc += c;
|
||||
acc += (uint64_t)c;
|
||||
}
|
||||
|
||||
c = *s;
|
||||
@@ -143,7 +143,7 @@ uint64_t strtoul_hex(const char *nptr)
|
||||
break;
|
||||
} else {
|
||||
acc *= base;
|
||||
acc += digit;
|
||||
acc += (uint64_t)digit;
|
||||
}
|
||||
|
||||
c = *s;
|
||||
|
||||
Reference in New Issue
Block a user