mirror of
https://github.com/isar/libmdbx.git
synced 2025-11-07 07:18:56 +08:00
mdbx: misc refines (minor).
Change-Id: Ia58e2d75e320bbd47dd352e082cf6f41afde075f
This commit is contained in:
@@ -208,13 +208,13 @@ int mdbx_asprintf(char **strp, const char *fmt, ...) {
|
||||
va_end(ap);
|
||||
|
||||
if (unlikely(needed < 0 || needed >= INT_MAX)) {
|
||||
*strp = NULL;
|
||||
*strp = nullptr;
|
||||
va_end(ones);
|
||||
return needed;
|
||||
}
|
||||
|
||||
*strp = malloc(needed + 1);
|
||||
if (unlikely(*strp == NULL)) {
|
||||
if (unlikely(*strp == nullptr)) {
|
||||
va_end(ones);
|
||||
SetLastError(MDBX_ENOMEM);
|
||||
return -1;
|
||||
@@ -231,7 +231,7 @@ int mdbx_asprintf(char **strp, const char *fmt, ...) {
|
||||
assert(actual == needed);
|
||||
if (unlikely(actual < 0)) {
|
||||
free(*strp);
|
||||
*strp = NULL;
|
||||
*strp = nullptr;
|
||||
}
|
||||
return actual;
|
||||
}
|
||||
@@ -246,7 +246,7 @@ int mdbx_memalign_alloc(size_t alignment, size_t bytes, void **result) {
|
||||
*result = memalign(alignment, bytes);
|
||||
return *result ? MDBX_SUCCESS : errno;
|
||||
#elif _POSIX_VERSION >= 200112L
|
||||
*result = NULL;
|
||||
*result = nullptr;
|
||||
return posix_memalign(result, alignment, bytes);
|
||||
#else
|
||||
#error FIXME
|
||||
|
||||
Reference in New Issue
Block a user