www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/14/19:45:10

From: Damian Yerrick <Bullcr_pd_yerrick AT hotmail DOT comRemoveBullcr_p>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: newbie makelong?
Organization: Pin Eight Software http://pineight.8m.com/
Message-ID: <nc0hps4fm0poukns0ipc59k7d6ssb8goog@4ax.com>
References: <39985C49 DOT 3542BDAC AT ntlworld DOT com> <39986125 DOT 80837DE6 AT ntlworld DOT com>
X-Newsreader: Forte Agent 1.7/32.534
MIME-Version: 1.0
Lines: 35
X-Trace: /bNDCzVyh79QSvgNr2xHyKpIVqTmZD7sjVJg4h4/T2Qiw4LXso/a8XC/poaBAwb7aYJW+tfDtnqi!LYQZD8mz2obvlvYNsd3wE6kdKZfks1sHYgoaaISjYxYG1cPkCLEUgFMgERH+Cnqa74FU8D1gkQGZ!TY8=
X-Complaints-To: abuse AT gte DOT net
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
NNTP-Posting-Date: Mon, 14 Aug 2000 23:33:00 GMT
Distribution: world
Date: Mon, 14 Aug 2000 23:33:00 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Mon, 14 Aug 2000 22:14:13 +0100, Steven Watson
<steven DOT watson AT ntlworld DOT com> wrote:

>  #include <sys/nearptr.h>
>  #include <crt0.h>
>
>  void * MK_FP (unsigned short seg, unsigned short ofs)
>  {
>    if ( !(_crt0_startup_flags & _CRT0_FLAG_NEARPTR) )
>      if (!__djgpp_nearptr_enable ())
>        return (void *)0;

On NT and in some other situations, this makes a null pointer.

>    return (void *) (seg*16 + ofs + __djgpp_conventional_base);
>  }

And you don't trap for the null pointer.

>>         ptr = MK_FP(0xB800,offset);
>> 
>>         while(*str)
>>         {
>>                 *ptr++= *str++;
>>                 ptr++;

On NT, your program will crash.

-- 
Damian Yerrick
"I refuse to listen to those who refuse to listen to reason."
See the whole sig: http://www.rose-hulman.edu/~yerricde/sig.html

This is McAfee VirusScan. Add these two lines to your signature to
prevent the spread of signature viruses.  http://www.mcafee.com/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019