openbsd-ports/devel/py-silc/patches/patch-src_pysilc_user_c
2007-10-02 17:35:48 +00:00

65 lines
2.2 KiB
Plaintext

$OpenBSD: patch-src_pysilc_user_c,v 1.3 2007/10/02 17:35:48 martynas Exp $
--- src/pysilc_user.c.orig Sun Jul 9 20:18:34 2006
+++ src/pysilc_user.c Sun Jul 1 22:52:11 2007
@@ -39,15 +39,12 @@ static PyObject *PySilcUser_GetAttr(PyObject *self, Py
// - char *server
// - char *realname
// - unsigned char *fingerprint;
- // SilcUInt32 finderprint_len;
//
// - 64/160 bit user id
// - unsigned int mode
// - (TODO) attrs;
// - (TODO) public_key;
- // - int status
// - (TODO) channels
- // - int resolve_cmd_ident;
int result;
PyObject *temp = NULL, *value = NULL;
@@ -137,7 +134,7 @@ static PyObject *PySilcUser_GetAttr(PyObject *self, Py
goto cleanup;
if (result == 0) {
if (pyuser->silcobj->fingerprint)
- value = PyString_FromStringAndSize(pyuser->silcobj->fingerprint, pyuser->silcobj->fingerprint_len);
+ value = PyString_FromStringAndSize(pyuser->silcobj->fingerprint, 20);
else {
value = Py_None;
Py_INCREF(value);
@@ -152,7 +149,7 @@ static PyObject *PySilcUser_GetAttr(PyObject *self, Py
goto cleanup;
if (result == 0) {
char buf[224];
- memcpy(&buf, (pyuser->silcobj->id), 224);
+ memcpy(&buf, &(pyuser->silcobj->id), 224);
value = PyString_FromStringAndSize(buf, 224);
goto cleanup;
}
@@ -164,26 +161,6 @@ static PyObject *PySilcUser_GetAttr(PyObject *self, Py
goto cleanup;
if (result == 0) {
value = PyInt_FromLong(pyuser->silcobj->mode);
- goto cleanup;
- }
-
- // check for status
- Py_DECREF(temp);
- temp = PyString_FromString("status");
- if (PyObject_Cmp(temp, name, &result) == -1)
- goto cleanup;
- if (result == 0) {
- value = PyInt_FromLong(pyuser->silcobj->status);
- goto cleanup;
- }
-
- // check for resolve_cmd_ident
- Py_DECREF(temp);
- temp = PyString_FromString("resolve_cmd_ident");
- if (PyObject_Cmp(temp, name, &result) == -1)
- goto cleanup;
- if (result == 0) {
- value = PyInt_FromLong(pyuser->silcobj->resolve_cmd_ident);
goto cleanup;
}