File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -74,18 +74,18 @@ static joseph *josp_play(joseph *josp, int hit)
74
74
}
75
75
fnode = pjs -> next ;
76
76
pjs -> next = pjs -> next -> next ;
77
- // free(fnode);
77
+ free (fnode );
78
78
fnode = NULL ;
79
79
pjs = pjs -> next ;
80
- }while (pjs != josp );
80
+ printf ("pjs->data %c\n" , pjs -> data );
81
+ }while (pjs != pjs -> next );
81
82
82
- printf ("pjs->data %c\n" , pjs -> data );
83
83
return pjs ;
84
84
}
85
85
86
86
int main (int argc , char * * argv )
87
87
{
88
- joseph * josp ;
88
+ joseph * josp = NULL ;
89
89
joseph * last ;
90
90
int people , hit ;
91
91
@@ -100,10 +100,9 @@ int main(int argc, char **argv)
100
100
101
101
josp_init (& josp , people );
102
102
josp_show (josp );
103
- josp_show (josp );
104
103
105
104
last = josp_play (josp , hit );
106
- // printf("last data: %c\n", last->data);
105
+ printf ("last data: %c\n" , last -> data );
107
106
108
107
return 0 ;
109
108
}
You can’t perform that action at this time.
0 commit comments