fixes to structmember.c

Lance Ellinghouse (lance@markv.com)
Sat, 3 Jul 93 21:43:23 PDT

Here are CVS diffs for a corrected version of structmember.c.
This fixes a couple bugs in the parsing routines for T_CHAR and
puts the fix I sugested for T_STRING...

Lance Ellinghouse
lance@markv.com
======
===================================================================
RCS file: /u/lance/CVS/python/src/structmember.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 structmember.c
104c104
< if (*(char**)addr == NULL) {

---
> 				if ((char*)addr == NULL) {
109c109
< 					v = newstringobject(*(char**)addr);
---
> 					v = newstringobject((char*)addr);
143c143
< 			if (l->readonly || l->type == T_STRING) {
---
> 			if (l->readonly) {
148a149,163
> 			case T_STRING:
> 				{
> 					int i, j;
> 					struct memberlist *g = l;
> 					if (!is_stringobject(v)) {
> 						err_badarg();
> 						return -1;
> 					}
> 					g++;
> 					i = g->offset;
> 					j = i - l->offset - 1;
> 					strncpy((char *)addr,getstringvalue(v),j);
> 					*(char *)(addr+j) = '\0';
> 					break;
> 				}
224a240
> 				break;