home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
sa104os2.zip
/
SATHR104.ZIP
/
SATHER
/
SYSTEM
/
BUGGYFIX.C
< prev
next >
Wrap
Text File
|
1995-02-14
|
963b
|
41 lines
/* workaround for problem in buggy.c */
#include <stdio.h>
typedef struct IDENT_struct {
long z;
} IDENT;
typedef struct TUPIDENTTP_struct {
IDENT t1;
long t2;
} TUPIDENTTP;
static TUPIDENTTP temp; /* added this variable */
typedef struct FMAPIDENTTP_struct {
TUPIDENTTP arr[1];
} *FMAPIDENTTP;
TUPIDENTTP FMAPIDENTTP_aget(FMAPIDENTTP self) {
return self->arr[0];
}
void FMAPIDENTTP_insert(FMAPIDENTTP self) {
long n = 5;
IDENT tk = {2};
fprintf(stderr,"1st n = %i\n", n); /* get "5" here */
/* tk = FMAPIDENTTP_aget(self).t1; replace this line with ... */
tk = (temp = FMAPIDENTTP_aget(self)).t1; /* this line */
fprintf(stderr,"2nd n = %i\n", n); /* get "5" here */
return;
}
struct FMAPIDENTTP_struct dummy ={{{{9},7}}};
int main(void)
{
FMAPIDENTTP_insert(&dummy);
return 0;
}