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
e462d459
Commit
e462d459
authored
Jun 20, 2007
by
Walter Dörwald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Silence GCC warning about uninitialzed variable.
Simplify formatlong() (by using PyUnicode_FromStringAndSize()).
parent
f79285ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
Objects/unicodeobject.c
Objects/unicodeobject.c
+5
-12
No files found.
Objects/unicodeobject.c
View file @
e462d459
...
@@ -540,7 +540,7 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
...
@@ -540,7 +540,7 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
va_list
count
;
va_list
count
;
Py_ssize_t
callcount
=
0
;
Py_ssize_t
callcount
=
0
;
PyObject
**
callresults
=
NULL
;
PyObject
**
callresults
=
NULL
;
PyObject
**
callresult
;
PyObject
**
callresult
=
NULL
;
Py_ssize_t
n
=
0
;
Py_ssize_t
n
=
0
;
int
width
=
0
;
int
width
=
0
;
int
precision
=
0
;
int
precision
=
0
;
...
@@ -7955,23 +7955,16 @@ static PyObject*
...
@@ -7955,23 +7955,16 @@ static PyObject*
formatlong
(
PyObject
*
val
,
int
flags
,
int
prec
,
int
type
)
formatlong
(
PyObject
*
val
,
int
flags
,
int
prec
,
int
type
)
{
{
char
*
buf
;
char
*
buf
;
int
i
,
len
;
int
len
;
PyObject
*
str
;
/* temporary string object. */
PyObject
*
str
;
/* temporary string object. */
Py
Unicode
Object
*
result
;
PyObject
*
result
;
str
=
_PyString_FormatLong
(
val
,
flags
,
prec
,
type
,
&
buf
,
&
len
);
str
=
_PyString_FormatLong
(
val
,
flags
,
prec
,
type
,
&
buf
,
&
len
);
if
(
!
str
)
if
(
!
str
)
return
NULL
;
return
NULL
;
result
=
_PyUnicode_New
(
len
);
result
=
PyUnicode_FromStringAndSize
(
buf
,
len
);
if
(
!
result
)
{
Py_DECREF
(
str
);
return
NULL
;
}
for
(
i
=
0
;
i
<
len
;
i
++
)
result
->
str
[
i
]
=
buf
[
i
];
result
->
str
[
len
]
=
0
;
Py_DECREF
(
str
);
Py_DECREF
(
str
);
return
(
PyObject
*
)
result
;
return
result
;
}
}
static
int
static
int
...
...
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