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
b2064d72
Kaydet (Commit)
b2064d72
authored
Nis 04, 2007
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix-up error-exits on struct_unpack().
üst
3608f057
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
_struct.c
Modules/_struct.c
+17
-13
No files found.
Modules/_struct.c
Dosyayı görüntüle @
b2064d72
...
...
@@ -1487,29 +1487,33 @@ s_unpack(PyObject *self, PyObject *inputstr)
{
char
*
start
;
int
len
;
PyObject
*
args
;
PyObject
*
args
=
NULL
,
*
result
;
PyStructObject
*
soself
=
(
PyStructObject
*
)
self
;
assert
(
PyStruct_Check
(
self
));
assert
(
soself
->
s_codes
!=
NULL
);
if
(
inputstr
!=
NULL
&&
PyString_Check
(
inputstr
)
&&
if
(
inputstr
==
NULL
)
goto
fail
;
if
(
PyString_Check
(
inputstr
)
&&
PyString_GET_SIZE
(
inputstr
)
==
soself
->
s_size
)
{
return
s_unpack_internal
(
soself
,
PyString_AS_STRING
(
inputstr
));
}
args
=
PyTuple_Pack
(
1
,
inputstr
);
if
(
args
==
NULL
)
return
NULL
;
if
(
!
PyArg_ParseTuple
(
args
,
"s#:unpack"
,
&
start
,
&
len
))
{
Py_DECREF
(
args
);
return
NULL
;
}
if
(
!
PyArg_ParseTuple
(
args
,
"s#:unpack"
,
&
start
,
&
len
))
goto
fail
;
if
(
soself
->
s_size
!=
len
)
goto
fail
;
result
=
s_unpack_internal
(
soself
,
start
);
Py_DECREF
(
args
);
if
(
soself
->
s_size
!=
len
)
{
PyErr_Format
(
StructError
,
"unpack requires a string argument of length %zd"
,
soself
->
s_size
);
return
NULL
;
}
return
s_unpack_internal
(
soself
,
start
);
return
result
;
fail:
Py_XDECREF
(
args
);
PyErr_Format
(
StructError
,
"unpack requires a string argument of length %zd"
,
soself
->
s_size
);
return
NULL
;
}
PyDoc_STRVAR
(
s_unpack_from__doc__
,
...
...
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