@@ -55,7 +55,6 @@ void returnOK(){
55
55
message += " Access-Control-Allow-Origin: *\r\n " ;
56
56
message += " \r\n " ;
57
57
client.print (message);
58
- message = 0 ;
59
58
client.stop ();
60
59
}
61
60
@@ -69,7 +68,6 @@ void returnFail(String msg){
69
68
message += msg;
70
69
message += " \r\n " ;
71
70
client.print (message);
72
- message = 0 ;
73
71
client.stop ();
74
72
}
75
73
@@ -108,8 +106,8 @@ bool loadFromSdCard(String path){
108
106
head += " \r\n Access-Control-Allow-Origin: *" ;
109
107
head += " \r\n\r\n " ;
110
108
client.print (head);
111
- dataType = 0 ;
112
- path = 0 ;
109
+ dataType = String () ;
110
+ path = String () ;
113
111
114
112
uint8_t obuf[WWW_BUF_SIZE];
115
113
@@ -172,11 +170,11 @@ void deleteRecursive(String path){
172
170
entry.close ();
173
171
SD.remove ((char *)entryPath.c_str ());
174
172
}
175
- entryPath = 0 ;
173
+ entryPath = String () ;
176
174
yield ();
177
175
}
178
176
SD.rmdir ((char *)path.c_str ());
179
- path = 0 ;
177
+ path = String () ;
180
178
file.close ();
181
179
}
182
180
@@ -186,7 +184,7 @@ void handleDelete(){
186
184
if (path == " /" || !SD.exists ((char *)path.c_str ())) return returnFail (" BAD PATH" );
187
185
deleteRecursive (path);
188
186
returnOK ();
189
- path = 0 ;
187
+ path = String () ;
190
188
}
191
189
192
190
void handleCreate (){
@@ -203,15 +201,15 @@ void handleCreate(){
203
201
SD.mkdir ((char *)path.c_str ());
204
202
}
205
203
returnOK ();
206
- path = 0 ;
204
+ path = String () ;
207
205
}
208
206
209
207
void printDirectory () {
210
208
if (!server.hasArg (" dir" )) return returnFail (" BAD ARGS" );
211
209
String path = server.arg (" dir" );
212
210
if (path != " /" && !SD.exists ((char *)path.c_str ())) return returnFail (" BAD PATH" );
213
211
File dir = SD.open ((char *)path.c_str ());
214
- path = 0 ;
212
+ path = String () ;
215
213
if (!dir.isDirectory ()){
216
214
dir.close ();
217
215
return returnFail (" NOT DIR" );
@@ -242,7 +240,7 @@ void printDirectory() {
242
240
output += " ]" ;
243
241
client.write (output.c_str (), output.length ());
244
242
client.stop ();
245
- output = 0 ;
243
+ output = String () ;
246
244
}
247
245
248
246
void handleNotFound (){
0 commit comments