home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!gumby!yale!yale.edu!ira.uka.de!smurf.sub.org!flatlin!pilhuhn!spirits!rob
- From: rob@spirits.ka.sub.org (Roland Bless)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Enforcer hits at 0000000
- Message-ID: <Gjp7s*Wv2@spirits.ka.sub.org>
- Date: Sat, 12 Dec 1992 09:58:34 GMT
- References: <1g56slINN1p2a@rs1.rrz.Uni-Koeln.DE>
- Organization: Blessed Software Products, private, Karlsruhe (FRG)
- MIME-Version: 1.0
- Content-Type: text/plain; charset=ISO-8859-1
- Content-transfer-encoding: 8bit
- X-Newsreader: Arn V1.00 pre
- Lines: 33
-
- In article <1g56slINN1p2a@rs1.rrz.Uni-Koeln.DE>, Wilhelm Stiefelhagen writes:
-
- > Last week I tested my Amiga-Programms with Enforcer. I got a lot of
- > Enfercer hits of programs reading at adress 00000000. Some of the
- > programs are candidates for crashes, some are not.
- > Is this enforcer hit so common, and what is the reason?
-
- The reason is that you/the programmer forgot to check for NULL-pointers.
- Something like:
-
- char *text= NULL;
- /* text isn't changed */
- printf("gaga %s",text);
-
- should be better (if text can contain the value NULL):
- char *text= NULL;
-
- if (text) printf("gaga %s",text);
-
- > (The docs of Enforcer said just "lowest page", but I get everytime
- > time (ok, nearly everytime) hits at the absolut lowest adress. So I am a
- > little bit concerned.)
-
- The main reason are pointers containing NULL that are used without
- an if().
-
- Regards,
- Roland
- --
- R o l a n d B l e s s |UUCP/USENET: rob@spirits.ka.sub.org IRC: rob|
- Groetzinger Strasse 44 |BITNET: UKG5@DKAUNI2.BITNET FAX: +49211623818 |
- 7500 Karlsruhe - FRG |---------spirits--in--the--material--world---------|
- voice +49 721 497381 | Die Menschheit lernt nie. Aus. |
-