diff options
author | Keith Bostic <keith@wiredtiger.com> | 2015-03-13 15:35:28 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2015-03-13 15:35:28 -0400 |
commit | dc19643859063a03b985d97e2f24b1262ec4b15d (patch) | |
tree | 8a2f443b9cdbf3116bc98b4bea48cd4d1b3b6217 /src/txn | |
parent | 22500eaf64a17fa8b5dec4600c35fac05965d364 (diff) | |
download | mongo-dc19643859063a03b985d97e2f24b1262ec4b15d.tar.gz |
Use SCNxxx #defines in sscanf() calls, not PRIxxx.
We can't cast a pointer to a WT_LSN.offset to a pointer to a different
type, we can't know WT_LSN.offset is the same size as that type.
Diffstat (limited to 'src/txn')
-rw-r--r-- | src/txn/txn_recover.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/txn/txn_recover.c b/src/txn/txn_recover.c index 2c834083691..bc098875abf 100644 --- a/src/txn/txn_recover.c +++ b/src/txn/txn_recover.c @@ -304,6 +304,7 @@ __recovery_setup_file(WT_RECOVERY *r, const char *uri, const char *config) { WT_CONFIG_ITEM cval; WT_LSN lsn; + intmax_t offset; uint32_t fileid; WT_RET(__wt_config_getones(r->session, config, "id", &cval)); @@ -325,8 +326,10 @@ __recovery_setup_file(WT_RECOVERY *r, const char *uri, const char *config) /* If there is checkpoint logged for the file, apply everything. */ if (cval.type != WT_CONFIG_ITEM_STRUCT) WT_INIT_LSN(&lsn); - else if (sscanf(cval.str, "(%" PRIu32 ",%" PRIdMAX ")", - &lsn.file, (intmax_t*)&lsn.offset) != 2) + else if (sscanf(cval.str, + "(%" SCNu32 ",%" SCNdMAX ")", &lsn.file, &offset) == 2) + lsn.offset = offset; + else WT_RET_MSG(r->session, EINVAL, "Failed to parse checkpoint LSN '%.*s'", (int)cval.len, cval.str); |