| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | help |
G'Day Daryl,
-=> Quoting Daryl Willis to All <=-
DW> when I pass the structure through this sorting routine
DW> I end up with a Null Pointer asignment. What sort of tests can
DW> char *tempattrib;
DW> long int size;
DW> char *tempfile; // temp storage for the swap
I think that's the problem neither tempattrib nor tempfile is a
storage, they're only a pointer.
so you'll have to have something like this before you attempt to use them
as storage..
tempfile = (char*) malloc(strlen(filefound)+1); /* (or MAXFILE ) */
if(!tempfile) return NOMEM; /* no memory */
and after finished using it, free(tempfile);
Ideally for this sort of thing you should declare tempfile like..
tempfile[MAXFILE]; where MAXFILE is defined 13 (in Borland it's in Dir.h)
This would do away with the need for the allocation, it is probably more
efficient, or at least more redable this way and 13 bytes in a subroutine
is likely to be available at all times.
same would apply to tempattrib, shouldn't that be only an integer anyway?
Hope this helps, but not as much as i hope that i'm right.:-)
L8r Frank (fadam{at}ozemail.com.au).
___ Blue Wave/DOS v2.21
--- Maximus 3.01
* Origin: The Software Parlour (3:635/544)SEEN-BY: 50/99 78/0 620/243 623/630 632/349 635/503 544 727 711/401 409 410 SEEN-BY: 711/413 430 808 809 932 934 712/515 713/888 714/906 800/1 7877/2809 @PATH: 635/544 50/99 711/808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.