mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-04-30 12:44:07 +00:00
sprintf: bug fix in sprintf implemented code
In the case that the copy sz is 0, it is unnecessary to do copy. Signed-off-by: Zheng, Gen <gen.zheng@intel.com> Reviewed-by: Chen, Jason Cl <jason.cj.chen@intel.com> Reviewed-by: Yakui, Zhao <yakui.zhao@intel.com>
This commit is contained in:
parent
9b37e1464c
commit
c5fabf55a0
@ -634,7 +634,7 @@ static int charmem(int cmd, const char *s, int sz, void *hnd)
|
||||
n++;
|
||||
}
|
||||
|
||||
} else {
|
||||
} else if (sz > 0) {
|
||||
while (*s && n < sz) {
|
||||
if (n < param->sz - param->wrtn)
|
||||
*p = *s;
|
||||
|
Loading…
Reference in New Issue
Block a user