use %p printf format spec for pointers

do not cast to unsigned long since a 64-bit pointer
and 32-bit long will truncate the value.

Change-Id: Ibeda98171ccbab4b55950bb02c858773e1028cbf
This commit is contained in:
Jeffrey Altman
2011-05-16 23:42:29 -04:00
committed by Jeffrey Altman
parent 844fa0ad5a
commit 36dcd37cc7
2 changed files with 9 additions and 9 deletions

View File

@@ -557,7 +557,7 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
break;
}
if (asprintf(&bname, "bmember_%s_%lu", name ? name : "", (unsigned long)t) < 0 || bname == NULL)
if (asprintf(&bname, "bmember_%s_%p", name ? name : "", t) < 0 || bname == NULL)
errx(1, "malloc");
output_name(bname);
@@ -620,7 +620,7 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
else
sename = symbol_name(basetype, t->subtype);
if (asprintf(&tname, "tag_%s_%lu", name ? name : "", (unsigned long)t) < 0 || tname == NULL)
if (asprintf(&tname, "tag_%s_%p", name ? name : "", t) < 0 || tname == NULL)
errx(1, "malloc");
output_name(tname);
@@ -670,7 +670,7 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
else if (t->type == TSequenceOf) type = "A1_OP_SEQOF";
else abort();
if (asprintf(&elname, "%s_%s_%lu", basetype, tname, (unsigned long)t) < 0 || elname == NULL)
if (asprintf(&elname, "%s_%s_%p", basetype, tname, t) < 0 || elname == NULL)
errx(1, "malloc");
generate_template_type(elname, &dupname, NULL, sename, NULL, t->subtype,

View File

@@ -518,8 +518,8 @@ scc_resolve(krb5_context context, krb5_ccache *id, const char *res)
sqlite3_reset(s->scache_name);
krb5_set_error_message(context, KRB5_CC_END,
N_("Cache name of wrong type "
"for scache %ld", ""),
(unsigned long)s->name);
"for scache %s", ""),
s->name);
scc_free(s);
return KRB5_CC_END;
}
@@ -902,8 +902,8 @@ scc_get_first (krb5_context context,
return KRB5_CC_END;
}
ret = asprintf(&name, "credIteration%luPid%d",
(unsigned long)ctx, (int)getpid());
ret = asprintf(&name, "credIteration%pPid%d",
ctx, (int)getpid());
if (ret < 0 || name == NULL) {
krb5_set_error_message(context, ENOMEM,
N_("malloc: out of memory", ""));
@@ -1173,8 +1173,8 @@ scc_get_cache_first(krb5_context context, krb5_cc_cursor *cursor)
return ret;
}
ret = asprintf(&name, "cacheIteration%luPid%d",
(unsigned long)ctx, (int)getpid());
ret = asprintf(&name, "cacheIteration%pPid%d",
ctx, (int)getpid());
if (ret < 0 || name == NULL) {
krb5_set_error_message(context, ENOMEM,
N_("malloc: out of memory", ""));