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:

committed by
Jeffrey Altman

parent
844fa0ad5a
commit
36dcd37cc7
@@ -557,7 +557,7 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
|
|||||||
break;
|
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");
|
errx(1, "malloc");
|
||||||
output_name(bname);
|
output_name(bname);
|
||||||
|
|
||||||
@@ -620,7 +620,7 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
|
|||||||
else
|
else
|
||||||
sename = symbol_name(basetype, t->subtype);
|
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");
|
errx(1, "malloc");
|
||||||
output_name(tname);
|
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 if (t->type == TSequenceOf) type = "A1_OP_SEQOF";
|
||||||
else abort();
|
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");
|
errx(1, "malloc");
|
||||||
|
|
||||||
generate_template_type(elname, &dupname, NULL, sename, NULL, t->subtype,
|
generate_template_type(elname, &dupname, NULL, sename, NULL, t->subtype,
|
||||||
|
@@ -518,8 +518,8 @@ scc_resolve(krb5_context context, krb5_ccache *id, const char *res)
|
|||||||
sqlite3_reset(s->scache_name);
|
sqlite3_reset(s->scache_name);
|
||||||
krb5_set_error_message(context, KRB5_CC_END,
|
krb5_set_error_message(context, KRB5_CC_END,
|
||||||
N_("Cache name of wrong type "
|
N_("Cache name of wrong type "
|
||||||
"for scache %ld", ""),
|
"for scache %s", ""),
|
||||||
(unsigned long)s->name);
|
s->name);
|
||||||
scc_free(s);
|
scc_free(s);
|
||||||
return KRB5_CC_END;
|
return KRB5_CC_END;
|
||||||
}
|
}
|
||||||
@@ -902,8 +902,8 @@ scc_get_first (krb5_context context,
|
|||||||
return KRB5_CC_END;
|
return KRB5_CC_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = asprintf(&name, "credIteration%luPid%d",
|
ret = asprintf(&name, "credIteration%pPid%d",
|
||||||
(unsigned long)ctx, (int)getpid());
|
ctx, (int)getpid());
|
||||||
if (ret < 0 || name == NULL) {
|
if (ret < 0 || name == NULL) {
|
||||||
krb5_set_error_message(context, ENOMEM,
|
krb5_set_error_message(context, ENOMEM,
|
||||||
N_("malloc: out of memory", ""));
|
N_("malloc: out of memory", ""));
|
||||||
@@ -1173,8 +1173,8 @@ scc_get_cache_first(krb5_context context, krb5_cc_cursor *cursor)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = asprintf(&name, "cacheIteration%luPid%d",
|
ret = asprintf(&name, "cacheIteration%pPid%d",
|
||||||
(unsigned long)ctx, (int)getpid());
|
ctx, (int)getpid());
|
||||||
if (ret < 0 || name == NULL) {
|
if (ret < 0 || name == NULL) {
|
||||||
krb5_set_error_message(context, ENOMEM,
|
krb5_set_error_message(context, ENOMEM,
|
||||||
N_("malloc: out of memory", ""));
|
N_("malloc: out of memory", ""));
|
||||||
|
Reference in New Issue
Block a user