Skip to content

Commit d916a0f

Browse files
committed
1 parent 510c927 commit d916a0f

File tree

3 files changed

+65
-3
lines changed

3 files changed

+65
-3
lines changed

libcpychecker/PyArg_ParseTuple.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright 2011 David Malcolm <dmalcolm@redhat.com>
2-
# Copyright 2011 Red Hat, Inc.
1+
# Copyright 2011, 2013 David Malcolm <dmalcolm@redhat.com>
2+
# Copyright 2011, 2013 Red Hat, Inc.
33
#
44
# This is free software: you can redistribute it and/or modify it
55
# under the terms of the GNU General Public License as published by
@@ -327,7 +327,7 @@ def from_string(cls, fmt_string, with_size_t):
327327
elif c == 'e':
328328
if next in ['s', 't']:
329329
arg = ConcreteUnit('e' + next,
330-
[(get_const_char_ptr(), NullPointer()),
330+
[(get_const_char_ptr(), get_char_ptr(), NullPointer()),
331331
gcc.Type.char().pointer.pointer])
332332
i += 1
333333
if i < len(fmt_string):
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
Copyright 2013 David Malcolm <dmalcolm@redhat.com>
3+
Copyright 2013 Red Hat, Inc.
4+
5+
This is free software: you can redistribute it and/or modify it
6+
under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful, but
11+
WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see
17+
<http://www.gnu.org/licenses/>.
18+
*/
19+
20+
/*
21+
*/
22+
#include <Python.h>
23+
24+
PyObject *
25+
test(PyObject *self, PyObject *args)
26+
{
27+
char *buffer = "I am a buffer";
28+
int ival;
29+
30+
if (!PyArg_ParseTuple(args, "et#", "utf-8", &buffer, &ival)) {
31+
return NULL;
32+
}
33+
34+
Py_RETURN_NONE;
35+
}
36+
37+
/*
38+
PEP-7
39+
Local variables:
40+
c-basic-offset: 4
41+
indent-tabs-mode: nil
42+
End:
43+
*/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2011 David Malcolm <dmalcolm@redhat.com>
2+
# Copyright 2011 Red Hat, Inc.
3+
#
4+
# This is free software: you can redistribute it and/or modify it
5+
# under the terms of the GNU General Public License as published by
6+
# the Free Software Foundation, either version 3 of the License, or
7+
# (at your option) any later version.
8+
#
9+
# This program is distributed in the hope that it will be useful, but
10+
# WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
# General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU General Public License
15+
# along with this program. If not, see
16+
# <http://www.gnu.org/licenses/>.
17+
18+
from libcpychecker import main
19+
main()

0 commit comments

Comments
 (0)