summaryrefslogtreecommitdiff
path: root/examples/c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/c')
-rw-r--r--examples/c/ex_all.c8
-rw-r--r--examples/c/ex_data_source.c5
2 files changed, 5 insertions, 8 deletions
diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c
index 51b4bb42040..51c63e307c6 100644
--- a/examples/c/ex_all.c
+++ b/examples/c/ex_all.c
@@ -357,12 +357,8 @@ cursor_ops(WT_SESSION *session)
const char *key = "non-existent key";
cursor->set_key(cursor, key);
if ((ret = cursor->remove(cursor)) != 0) {
- char buf[128];
-
- if (wiredtiger_strerror_r(ret, buf, sizeof(buf)) != 0)
- (void)snprintf(
- buf, sizeof(buf), "error value: %d\n", ret);
- fprintf(stderr, "cursor.remove: %s\n", buf);
+ fprintf(stderr,
+ "cursor.remove: %s\n", session->strerror(session, ret));
return (ret);
}
/*! [Display an error thread safe] */
diff --git a/examples/c/ex_data_source.c b/examples/c/ex_data_source.c
index 5043fa1b67d..7fb400b5922 100644
--- a/examples/c/ex_data_source.c
+++ b/examples/c/ex_data_source.c
@@ -75,8 +75,9 @@ my_create(WT_DATA_SOURCE *dsrc, WT_SESSION *session,
{
int ret = 0;
/*! [WT_EXTENSION_API strerror] */
- (void)wt_api->err_printf(wt_api,
- session, "WiredTiger error return: %s", wt_api->strerror(ret));
+ (void)wt_api->err_printf(wt_api, session,
+ "WiredTiger error return: %s",
+ wt_api->strerror(wt_api, session, ret));
/*! [WT_EXTENSION_API strerror] */
}