Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
59a42ef5
Commit
59a42ef5
authored
Dec 05, 2001
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace sprintf() with PyOS_snprintf().
parent
81971bd8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
Mac/Modules/hfsplusmodule.c
Mac/Modules/hfsplusmodule.c
+4
-4
Mac/Modules/macfsmodule.c
Mac/Modules/macfsmodule.c
+1
-1
Mac/Python/macimport.c
Mac/Python/macimport.c
+4
-4
No files found.
Mac/Modules/hfsplusmodule.c
View file @
59a42ef5
...
...
@@ -1251,9 +1251,9 @@ PyObject *macos_error_for_call(OSErr err, const char *name, const char *item)
char
buffer
[
1024
];
if
(
item
)
sprintf
(
buffer
,
"mac error calling %s on %s"
,
name
,
item
);
PyOS_snprintf
(
buffer
,
sizeof
(
buffer
)
,
"mac error calling %s on %s"
,
name
,
item
);
else
sprintf
(
buffer
,
"mac error calling %s"
,
name
);
PyOS_snprintf
(
buffer
,
sizeof
(
buffer
)
,
"mac error calling %s"
,
name
);
v
=
Py_BuildValue
(
"(is)"
,
err
,
buffer
);
if
(
v
!=
NULL
)
{
...
...
@@ -1376,9 +1376,9 @@ void printableUniStr(const HFSUniStr255 *uni, char *buffer)
UniChar
uch
=
uni
->
unicode
[
i
];
if
((
uch
&
0x7f
)
==
uch
)
{
sprintf
(
localbuf
,
"%c"
,
uch
);
PyOS_snprintf
(
localbuf
,
sizeof
(
localbuf
)
,
"%c"
,
uch
);
}
else
{
sprintf
(
localbuf
,
"
\\
u%04x"
,
uch
);
PyOS_snprintf
(
localbuf
,
sizeof
(
localbuf
)
,
"
\\
u%04x"
,
uch
);
}
strcat
(
buffer
,
localbuf
);
}
...
...
Mac/Modules/macfsmodule.c
View file @
59a42ef5
...
...
@@ -706,7 +706,7 @@ mfss_repr(mfssobject *self)
{
char
buf
[
512
];
sprintf
(
buf
,
"FSSpec((%d, %ld, '%.*s'))"
,
PyOS_snprintf
(
buf
,
sizeof
(
buf
)
,
"FSSpec((%d, %ld, '%.*s'))"
,
self
->
fsspec
.
vRefNum
,
self
->
fsspec
.
parID
,
self
->
fsspec
.
name
[
0
],
self
->
fsspec
.
name
+
1
);
...
...
Mac/Python/macimport.c
View file @
59a42ef5
...
...
@@ -223,7 +223,7 @@ PyMac_LoadCodeResourceModule(name, pathname)
packagecontext
=
name
;
shortname
=
lastdot
+
1
;
}
sprintf
(
funcname
,
FUNCNAME_PATTERN
,
shortname
);
PyOS_snprintf
(
funcname
,
sizeof
(
funcname
)
,
FUNCNAME_PATTERN
,
shortname
);
if
(
!
findnamedresource
((
PyStringObject
*
)
0
,
name
,
pathname
,
'
PYD
'
,
fragmentname
))
{
PyErr_SetString
(
PyExc_ImportError
,
"PYD resource not found"
);
return
NULL
;
...
...
@@ -235,7 +235,7 @@ PyMac_LoadCodeResourceModule(name, pathname)
kLoadCFrag
,
&
connID
,
&
mainAddr
,
errMessage
);
if
(
err
)
{
sprintf
(
buf
,
"%.*s: %.200s"
,
PyOS_snprintf
(
buf
,
sizeof
(
buf
)
,
"%.*s: %.200s"
,
errMessage
[
0
],
errMessage
+
1
,
PyMac_StrError
(
err
));
PyErr_SetString
(
PyExc_ImportError
,
buf
);
...
...
@@ -244,7 +244,7 @@ PyMac_LoadCodeResourceModule(name, pathname)
/* Locate the address of the correct init function */
err
=
FindSymbol
(
connID
,
Pstring
(
funcname
),
&
symAddr
,
&
class
);
if
(
err
)
{
sprintf
(
buf
,
"%s: %.200s"
,
PyOS_snprintf
(
buf
,
sizeof
(
buf
)
,
"%s: %.200s"
,
funcname
,
PyMac_StrError
(
err
));
PyErr_SetString
(
PyExc_ImportError
,
buf
);
return
NULL
;
...
...
@@ -405,7 +405,7 @@ error:
{
char
buf
[
512
];
sprintf
(
buf
,
"%s: %s"
,
filename
,
PyMac_StrError
(
err
));
PyOS_snprintf
(
buf
,
sizeof
(
buf
)
,
"%s: %s"
,
filename
,
PyMac_StrError
(
err
));
PyErr_SetString
(
PyExc_ImportError
,
buf
);
return
NULL
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment