replace %#s with portable solution

This commit is contained in:
Guido van Rossum 1995-02-20 23:43:29 +00:00
parent 4cbb0e3a2d
commit f45b53b13c
1 changed files with 14 additions and 13 deletions

View File

@ -191,7 +191,7 @@ mfsa_dealloc(self)
DEL(self);
}
static typeobject Mfsatype = {
statichere typeobject Mfsatype = {
OB_HEAD_INIT(&Typetype)
0, /*ob_size*/
"Alias", /*tp_name*/
@ -394,9 +394,10 @@ mfss_repr(self)
{
char buf[512];
/* XXXX Does %#s work for all compilers? */
sprintf(buf, "FSSpec((%d, %d, '%#s'))", self->fsspec.vRefNum,
self->fsspec.parID, self->fsspec.name);
sprintf(buf, "FSSpec((%d, %d, '%.*s'))",
self->fsspec.vRefNum,
self->fsspec.parID,
self->fsspec.name[0], self->fsspec.name+1);
return newstringobject(buf);
}
@ -420,7 +421,7 @@ mfss_compare(v, w)
return res;
}
static typeobject Mfsstype = {
statichere typeobject Mfsstype = {
OB_HEAD_INIT(&Typetype)
0, /*ob_size*/
"FSSpec", /*tp_name*/