Return to BSD News archive
Newsgroups: comp.unix.bsd.freebsd.misc Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.sprintlink.net!cs.utexas.edu!howland.reston.ans.net!Germany.EU.net!news.dfn.de!news.belwue.de!News.Uni-Marburg.DE!news.th-darmstadt.de!hrz-ws11.hrz.uni-kassel.de!phase23!citylink.dinoex.sub.org!peter From: peter@citylink.dinoex.sub.org (Peter Much) Subject: Re: porting Linux apps to BSD ! Organization: Buero fuer Sektenforschung und Qualitaetspruefung in der Esoterik Message-ID: <DDy17I.1ow@citylink.dinoex.sub.org> References: <aak2.808728796@Ra.MsState.Edu> <41g4do$3cq@agate.berkeley.edu> <DDuFps.2t6@citylink.dinoex.sub.org> <41kidg$fpj@bonnie.tcd-dresden.de> Date: Sun, 27 Aug 1995 00:26:05 GMT Lines: 24 In article <41kidg$fpj@bonnie.tcd-dresden.de>, J Wunsch <joerg_wunsch@uriah.heep.sax.de> wrote: >But i think that (null) is just a feature of the printf family: before >dereferencing a string pointer, it is being checked for a NULL >dereference. Quite as useful as a core dump, since you can also >easily spot where it happens (IMHO). You're right! That string is just between the hex-chars tables in a (static linked) binary; nm tells that belonging to some vfprintf stuff. strcmp(NULL, NULL) segmentation faults on FreeBSD (somewhere >2.0) and NetBSD 1.0, runs on Linux with libc 4.5.26, and segfaults on another Linux with libc 4.6.27. To be precise, strcmp(0,0) segfaults on FreeBSD; NULL won't compile since /usr/include/sys points into the (tar'ed&com- pressed) sourcetree... ;) printf("%s", NULL) prints "(null)" on FreeBSD, NetBSD and both Linux'. Peter -- UNIX is a religion. Religions cannot be trademarked. Write to: Peter Much * Koelnische Str. 22 * D-34117 Kassel * +49-561-774961 peter@citylink.dinoex.sub.org much@hrz.uni-kassel.de p.much@asco.nev.sub.de