@@ -332,15 +332,22 @@ class Text : public Printable {
332
332
uint16_t split (T* arr, uint16_t len, char div) const {
333
333
if (!len || !length ()) return 0 ;
334
334
find_t f;
335
- while (!f.last ) arr[f.count - 1 ] = _parse (div, 1 , len, f);
335
+
336
+ while (!f.last ) {
337
+ Text txt = _parse (div, 1 , len, f);
338
+ arr[f.count - 1 ] = txt;
339
+ }
336
340
return f.count ;
337
341
}
338
342
339
343
template <typename T>
340
344
uint16_t split (T** arr, uint16_t len, char div) const {
341
345
if (!len || !length ()) return 0 ;
342
346
find_t f;
343
- while (!f.last ) *(arr[f.count - 1 ]) = _parse (div, 1 , len, f);
347
+ while (!f.last ) {
348
+ Text txt = _parse (div, 1 , len, f);
349
+ *(arr[f.count - 1 ]) = txt;
350
+ }
344
351
return f.count ;
345
352
}
346
353
@@ -356,15 +363,21 @@ class Text : public Printable {
356
363
uint16_t split (T* arr, uint16_t len, const Text& div) const {
357
364
if (!len || !length () || !div.length () || div._len > _len) return 0 ;
358
365
find_t f;
359
- while (!f.last ) arr[f.count - 1 ] = _parse (div, div._len , len, f);
366
+ while (!f.last ) {
367
+ Text txt = _parse (div, div._len , len, f);
368
+ arr[f.count - 1 ] = txt;
369
+ }
360
370
return f.count ;
361
371
}
362
372
363
373
template <typename T>
364
374
uint16_t split (T** arr, uint16_t len, const Text& div) const {
365
375
if (!len || !length () || !div.length () || div._len > _len) return 0 ;
366
376
find_t f;
367
- while (!f.last ) *(arr[f.count - 1 ]) = _parse (div, div._len , len, f);
377
+ while (!f.last ) {
378
+ Text txt = _parse (div, div._len , len, f);
379
+ *(arr[f.count - 1 ]) = txt;
380
+ }
368
381
return f.count ;
369
382
}
370
383
0 commit comments