| fname = fname2; | fname = fname2; | ||||
| } | } | ||||
| fname_temp[0] = 0; | |||||
| f = NULL; | f = NULL; | ||||
| if ((f = fopen(fname, "rb")) != NULL) { | if ((f = fopen(fname, "rb")) != NULL) { | ||||
| int ix; | int ix; | ||||
| if (fread(p, 1, length, f) != length) { | if (fread(p, 1, length, f) != length) { | ||||
| int error = errno; | int error = errno; | ||||
| fclose(f); | fclose(f); | ||||
| remove(fname_temp); | |||||
| if (fname_temp[0]) | |||||
| remove(fname_temp); | |||||
| free(p); | free(p); | ||||
| return create_file_error_context(context, error, fname); | return create_file_error_context(context, error, fname); | ||||
| } | } | ||||
| fclose(f); | fclose(f); | ||||
| remove(fname_temp); | |||||
| if (fname_temp[0]) | |||||
| remove(fname_temp); | |||||
| ip = (int *)(&p[40]); | ip = (int *)(&p[40]); | ||||
| soundicon_tab[index].length = (*ip) / 2; // length in samples | soundicon_tab[index].length = (*ip) / 2; // length in samples |