Fix Int64ToString producing incorrect output (#1723)

This commit is contained in:
James Dickens 2022-03-04 22:03:35 +11:00 committed by GitHub
parent f307e44b79
commit 9df93b0708
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,7 +170,7 @@ static cell_t Int64ToString(IPluginContext *pCtx, const cell_t *params)
char *str; char *str;
pCtx->LocalToPhysAddr(params[1], &num); pCtx->LocalToPhysAddr(params[1], &num);
pCtx->LocalToString(params[2], &str); pCtx->LocalToString(params[2], &str);
size_t res = ke::SafeSprintf(str, params[3], "%" KE_FMT_I64, (int64_t)num[1] << 32ll | (int64_t)num[0]); size_t res = ke::SafeSprintf(str, params[3], "%" KE_FMT_I64, (uint64_t)num[1] << 32ll | (uint32_t)num[0]);
return static_cast<cell_t>(res); return static_cast<cell_t>(res);
} }