avoid 32-bit integer overflow when allocating memory for neighbor list copy

This commit is contained in:
Axel Kohlmeyer
2023-04-20 14:42:48 -04:00
parent c2027d7512
commit 5c8f3a0c95
2 changed files with 6 additions and 6 deletions

View File

@ -62,8 +62,7 @@ void *Memory::smalloc(bigint nbytes, const char *name)
void *ptr = malloc(nbytes);
#endif
if (ptr == nullptr)
error->one(FLERR,"Failed to allocate {} bytes for array {}",
nbytes,name);
error->one(FLERR,"Failed to allocate {} bytes for array {}", nbytes,name);
return ptr;
}