In krb5_db2_db_init, make a format string constant to make Coverity
authorGreg Hudson <ghudson@mit.edu>
Wed, 25 Nov 2009 14:36:05 +0000 (14:36 +0000)
committerGreg Hudson <ghudson@mit.edu>
Wed, 25 Nov 2009 14:36:05 +0000 (14:36 +0000)
happy.  (Previously it was a disjunction of two constants, which is
fine, but not as obviously safe to a static analysis tool.)

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23355 dc483132-0cff-0310-8789-dd5450dbe970

src/plugins/kdb/db2/kdb_db2.c

index 042649e49f0497aae3f1ce436c4985011759c0b9..50d427ef5a617daae21899db74b553c3169b3c3a 100644 (file)
@@ -338,9 +338,8 @@ krb5_db2_db_init(krb5_context context)
     if ((retval = krb5_db2_db_get_age(context, NULL, &db_ctx->db_lf_time)))
         goto err_out;
 
-    snprintf(policy_db_name, sizeof(policy_db_name),
-             db_ctx->tempdb ? "%s~.kadm5" : "%s.kadm5",
-             db_ctx->db_name);
+    snprintf(policy_db_name, sizeof(policy_db_name), "%s%s.kadm5",
+             db_ctx->db_name, db_ctx->tempdb ? "~" : "");
     snprintf(policy_lock_name, sizeof(policy_lock_name),
              "%s.lock", policy_db_name);