0001-Fix-.m3u-playlist-http-downloading.patch
| src/m3u/m3u.c | ||
|---|---|---|
| 41 | 41 | |
| 42 | 42 |
static char * read_win_text (VFSFile * file) |
| 43 | 43 |
{
|
| 44 |
int64_t size = vfs_fsize (file); |
|
| 45 |
if (size < 1) |
|
| 46 |
return NULL; |
|
| 44 |
int64_t size = 0; |
|
| 45 |
int64_t alloc = vfs_fsize (file); |
|
| 46 |
char * raw = NULL; |
|
| 47 |
if (alloc < 1) |
|
| 48 |
alloc = 8191; |
|
| 47 | 49 | |
| 48 |
char * raw = malloc (size + 1); |
|
| 49 |
size = vfs_fread (raw, 1, size, file); |
|
| 50 |
for (;;) |
|
| 51 |
{
|
|
| 52 |
int64_t rd; |
|
| 53 |
raw = realloc (raw, alloc + 1); |
|
| 54 |
rd = vfs_fread (raw + size, 1, alloc - size, file); |
|
| 55 |
if (! rd) |
|
| 56 |
break; |
|
| 57 |
size += rd; |
|
| 58 |
alloc += rd; |
|
| 59 |
} |
|
| 50 | 60 |
raw[size] = 0; |
| 51 | 61 | |
| 52 | 62 |
strip_char (raw, '\r'); |
| 53 |
- |
|
