]> git.sur5r.net Git - openldap/commitdiff
sprintf format: pid_t need not be an int.
authorHallvard Furuseth <hallvard@openldap.org>
Sun, 29 Dec 2013 14:57:33 +0000 (15:57 +0100)
committerHallvard Furuseth <hallvard@openldap.org>
Sun, 29 Dec 2013 14:57:33 +0000 (15:57 +0100)
libraries/liblmdb/mdb.c

index a7790cdd7a07d078dcee78b8a81cc5b4e6971e93..a312ba4566cac91d0c6630c4836e58b8f5652a27 100644 (file)
@@ -8303,13 +8303,10 @@ int mdb_reader_list(MDB_env *env, MDB_msg_func *func, void *ctx)
        mr = env->me_txns->mti_readers;
        for (i=0; i<rdrs; i++) {
                if (mr[i].mr_pid) {
-                       size_t tid;
-                       tid = mr[i].mr_tid;
-                       if (mr[i].mr_txnid == (txnid_t)-1) {
-                               sprintf(buf, "%10d %"Z"x -\n", mr[i].mr_pid, tid);
-                       } else {
-                               sprintf(buf, "%10d %"Z"x %"Z"u\n", mr[i].mr_pid, tid, mr[i].mr_txnid);
-                       }
+                       txnid_t txnid = mr[i].mr_txnid;
+                       sprintf(buf, txnid == (txnid_t)-1 ?
+                               "%10d %"Z"x -\n" : "%10d %"Z"x %"Z"u\n",
+                               (int)mr[i].mr_pid, (size_t)mr[i].mr_tid, txnid);
                        if (first) {
                                first = 0;
                                rc = func("    pid     thread     txnid\n", ctx);