Skip to content

Commit 0e3cbc1

Browse files
author
Alexander Korotkov
committed
Fix parse_int64.
1 parent 4330396 commit 0e3cbc1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/backend/utils/misc/guc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5683,11 +5683,11 @@ parse_int64(const char *value, int64 *result, int flags, const char **hintmsg)
56835683
/* We assume here that int64 is at least as wide as long */
56845684
errno = 0;
56855685
#ifdef _MSC_VER /* MSVC only */
5686-
val = _strtoui64(value, &endptr, 10);
5687-
#elif defined(HAVE_STRTOULL) && SIZEOF_LONG < 8
5688-
val = strtoull(value, &endptr, 10);
5686+
val = _strtoi64(value, &endptr, 10);
5687+
#elif defined(HAVE_STRTOLL) && SIZEOF_LONG < 8
5688+
val = strtoll(value, &endptr, 10);
56895689
#else
5690-
val = strtoul(value, &endptr, 10);
5690+
val = strtol(value, &endptr, 10);
56915691
#endif
56925692

56935693
if (endptr == value)
@@ -5701,7 +5701,7 @@ parse_int64(const char *value, int64 *result, int flags, const char **hintmsg)
57015701
}
57025702

57035703
if (result)
5704-
*result = (int) val;
5704+
*result = val;
57055705
return true;
57065706
}
57075707

src/include/pg_config_manual.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@
264264
* facilitate catching code that depends on the contents of uninitialized
265265
* memory. Caution: this is horrendously expensive.
266266
*/
267-
/* #define RANDOMIZE_ALLOCATED_MEMORY */
267+
#define RANDOMIZE_ALLOCATED_MEMORY
268268

269269
/*
270270
* Define this to force all parse and plan trees to be passed through

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy