回答編集履歴
2
修正
test
CHANGED
@@ -31,6 +31,14 @@
|
|
31
31
|
char *str,*str2,*buf,*mou;
|
32
32
|
|
33
33
|
str = (char *) malloc(BUFSIZE);
|
34
|
+
|
35
|
+
if( str == NULL ) {
|
36
|
+
|
37
|
+
printf( "メモリ確保エラー\n" );
|
38
|
+
|
39
|
+
return 3;
|
40
|
+
|
41
|
+
}
|
34
42
|
|
35
43
|
strcpy(str,"[Wakamatsu]"); /* 初期データ用文字列 */
|
36
44
|
|
1
変更
test
CHANGED
@@ -98,8 +98,6 @@
|
|
98
98
|
|
99
99
|
}
|
100
100
|
|
101
|
-
bsize+=BUFSIZE;
|
102
|
-
|
103
101
|
if(str2 != str){
|
104
102
|
|
105
103
|
memcpy(str2,str,bsize);
|
@@ -109,6 +107,8 @@
|
|
109
107
|
str=str2;
|
110
108
|
|
111
109
|
}
|
110
|
+
|
111
|
+
bsize+=BUFSIZE;
|
112
112
|
|
113
113
|
}
|
114
114
|
|