summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2016-03-16 11:34:27 -0400
committerKeith Bostic <keith@wiredtiger.com>2016-03-16 11:34:27 -0400
commite782e1ce92c9786f3ed41277f386192cb683abba (patch)
tree475f7895b5e29533e0a99a22120842e4675e8671 /src
parent1a698c5f5495555d51cc7bf5d3209433e3b9a083 (diff)
downloadmongo-e782e1ce92c9786f3ed41277f386192cb683abba.tar.gz
WT-2492 Change printf format specifier to be Windows compatible.
Windows doesn't like %td, use the maximum unsigned integer format instead, PRIuMAX. Get rid of the temporary variable I introduced in cc0d34b, there's no need for one.
Diffstat (limited to 'src')
-rw-r--r--src/config/config.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/config/config.c b/src/config/config.c
index 4eadaf2f008..a50c4d29f65 100644
--- a/src/config/config.c
+++ b/src/config/config.c
@@ -15,14 +15,14 @@
static int
__config_err(WT_CONFIG *conf, const char *msg, int err)
{
- uint64_t offset;
-
- /* Cast because printing a pointer diff isn't platform portable */
- offset = (uint64_t)(conf->cur - conf->orig);
-
+ /*
+ * Cast the string offset to uintmax_t because the %td format to print
+ * a type ptrdiff_t isn't supported under MSVC.
+ */
WT_RET_MSG(conf->session, err,
- "Error parsing '%.*s' at offset %" PRIu64 ": %s",
- (int)(conf->end - conf->orig), conf->orig, offset, msg);
+ "Error parsing '%.*s' at offset %" PRIuMAX ": %s",
+ (int)(conf->end - conf->orig), conf->orig,
+ (uintmax_t)(conf->cur - conf->orig), msg);
}
/*