Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
8ce358f5
Kaydet (Commit)
8ce358f5
authored
Nis 13, 2006
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replace most INT_MAX with PY_SSIZE_T_MAX.
üst
7cbc0f55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
stringobject.c
Objects/stringobject.c
+11
-11
No files found.
Objects/stringobject.c
Dosyayı görüntüle @
8ce358f5
...
...
@@ -105,7 +105,7 @@ PyString_FromString(const char *str)
assert
(
str
!=
NULL
);
size
=
strlen
(
str
);
if
(
size
>
IN
T_MAX
)
{
if
(
size
>
PY_SSIZE_
T_MAX
)
{
PyErr_SetString
(
PyExc_OverflowError
,
"string is too long for a Python string"
);
return
NULL
;
...
...
@@ -814,7 +814,7 @@ PyString_Repr(PyObject *obj, int smartquotes)
register
PyStringObject
*
op
=
(
PyStringObject
*
)
obj
;
size_t
newsize
=
2
+
4
*
op
->
ob_size
;
PyObject
*
v
;
if
(
newsize
>
IN
T_MAX
)
{
if
(
newsize
>
PY_SSIZE_
T_MAX
)
{
PyErr_SetString
(
PyExc_OverflowError
,
"string is too large to make repr"
);
}
...
...
@@ -1414,7 +1414,7 @@ string_split(PyStringObject *self, PyObject *args)
if
(
!
PyArg_ParseTuple
(
args
,
"|Oi:split"
,
&
subobj
,
&
maxsplit
))
return
NULL
;
if
(
maxsplit
<
0
)
maxsplit
=
IN
T_MAX
;
maxsplit
=
PY_SSIZE_
T_MAX
;
if
(
subobj
==
Py_None
)
return
split_whitespace
(
s
,
len
,
maxsplit
);
if
(
PyString_Check
(
subobj
))
{
...
...
@@ -1555,7 +1555,7 @@ string_rsplit(PyStringObject *self, PyObject *args)
if
(
!
PyArg_ParseTuple
(
args
,
"|Oi:rsplit"
,
&
subobj
,
&
maxsplit
))
return
NULL
;
if
(
maxsplit
<
0
)
maxsplit
=
IN
T_MAX
;
maxsplit
=
PY_SSIZE_
T_MAX
;
if
(
subobj
==
Py_None
)
return
rsplit_whitespace
(
s
,
len
,
maxsplit
);
if
(
PyString_Check
(
subobj
))
{
...
...
@@ -1685,7 +1685,7 @@ string_join(PyStringObject *self, PyObject *orig)
sz
+=
PyString_GET_SIZE
(
item
);
if
(
i
!=
0
)
sz
+=
seplen
;
if
(
sz
<
old_sz
||
sz
>
IN
T_MAX
)
{
if
(
sz
<
old_sz
||
sz
>
PY_SSIZE_
T_MAX
)
{
PyErr_SetString
(
PyExc_OverflowError
,
"join() is too long for a Python string"
);
Py_DECREF
(
seq
);
...
...
@@ -1746,7 +1746,7 @@ string_find_internal(PyStringObject *self, PyObject *args, int dir)
{
const
char
*
s
=
PyString_AS_STRING
(
self
),
*
sub
;
Py_ssize_t
len
=
PyString_GET_SIZE
(
self
);
Py_ssize_t
n
,
i
=
0
,
last
=
IN
T_MAX
;
Py_ssize_t
n
,
i
=
0
,
last
=
PY_SSIZE_
T_MAX
;
PyObject
*
subobj
;
/* XXX ssize_t i */
...
...
@@ -2158,7 +2158,7 @@ string_count(PyStringObject *self, PyObject *args)
{
const
char
*
s
=
PyString_AS_STRING
(
self
),
*
sub
,
*
t
;
Py_ssize_t
len
=
PyString_GET_SIZE
(
self
),
n
;
Py_ssize_t
i
=
0
,
last
=
IN
T_MAX
;
Py_ssize_t
i
=
0
,
last
=
PY_SSIZE_
T_MAX
;
Py_ssize_t
m
,
r
;
PyObject
*
subobj
;
...
...
@@ -2446,7 +2446,7 @@ mymemreplace(const char *str, Py_ssize_t len, /* input string */
/* find length of output string */
nfound
=
(
pat_len
>
0
)
?
mymemcnt
(
str
,
len
,
pat
,
pat_len
)
:
len
+
1
;
if
(
count
<
0
)
count
=
IN
T_MAX
;
count
=
PY_SSIZE_
T_MAX
;
else
if
(
nfound
>
count
)
nfound
=
count
;
if
(
nfound
==
0
)
...
...
@@ -2595,7 +2595,7 @@ string_startswith(PyStringObject *self, PyObject *args)
const
char
*
prefix
;
Py_ssize_t
plen
;
Py_ssize_t
start
=
0
;
Py_ssize_t
end
=
IN
T_MAX
;
Py_ssize_t
end
=
PY_SSIZE_
T_MAX
;
PyObject
*
subobj
;
if
(
!
PyArg_ParseTuple
(
args
,
"O|O&O&:startswith"
,
&
subobj
,
...
...
@@ -2646,7 +2646,7 @@ string_endswith(PyStringObject *self, PyObject *args)
const
char
*
suffix
;
Py_ssize_t
slen
;
Py_ssize_t
start
=
0
;
Py_ssize_t
end
=
IN
T_MAX
;
Py_ssize_t
end
=
PY_SSIZE_
T_MAX
;
PyObject
*
subobj
;
if
(
!
PyArg_ParseTuple
(
args
,
"O|O&O&:endswith"
,
&
subobj
,
...
...
@@ -3701,7 +3701,7 @@ _PyString_FormatLong(PyObject *val, int flags, int prec, int type,
}
buf
=
PyString_AsString
(
result
);
llen
=
PyString_Size
(
result
);
if
(
llen
>
IN
T_MAX
)
{
if
(
llen
>
PY_SSIZE_
T_MAX
)
{
PyErr_SetString
(
PyExc_ValueError
,
"string too large in _PyString_FormatLong"
);
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