Mail Archives: djgpp/1999/09/09/07:23:14
aperes (ajps AT mail DOT telepac DOT pt) wrote:
: Why this program receives SIGSEGV?
[Klippa, klapp, kluppit.]
: int main(void)
: {
: ......
:
: Load_Sound(..............);
Perhaps you mean Sound_Load?
: .......
:
: return 0;
: }
:
:
: int Sound_Load(char *filename, ssound_ptr the_sound, int translate)
: {
: ......
: ......
: int *selector;
^^^^^^^^
Uninitialised pointer.
: ..........
:
: if(_dos_open(filename, _O_RDONLY, &sound_handle)) { OK
: printf("file not found");
: return 1;
: }
:
: size_of_file = filelength(sound_handle);
: tmp_ptr = s_ptr =
: (unsigned char*)__dpmi_allocate_dos_memory((size_of_file+15) >> 4,
: selector); OK
Here you pass a pointer pointing to anywhere. Expect weird behaviour.
Keep in mind that I'm not an expert on low level DOZE programming.
Right,
MartinS
- Raw text -