Deutsch   English   Français   Italiano  
<mbto46FjbqdU4@mid.individual.net>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: rbowman <bowman@montana.com>
Newsgroups: comp.os.linux.misc
Subject: Re: VMS
Date: 23 Jun 2025 19:27:02 GMT
Lines: 14
Message-ID: <mbto46FjbqdU4@mid.individual.net>
References: <wCqdnYde9MIbmND1nZ2dnZfqnPadnZ2d@giganews.com>
	<87tt4i9nw5.fsf@eder.anydns.info> <102l0h9$fjtb$5@dont-email.me>
	<Z2udned3u9ZgqtP1nZ2dnZfqnPudnZ2d@giganews.com>
	<slrn1054j9c.3ce8.candycanearter07@candydeb.host.invalid>
	<PpudnVnCnvuYxc_1nZ2dnZfqnPudnZ2d@giganews.com>
	<wwva564xjps.fsf@LkoBDZeT.terraraq.uk>
	<4_GdncCsf-Nqe8n1nZ2dnZfqnPSdnZ2d@giganews.com>
	<wwv5xgqkfl9.fsf@LkoBDZeT.terraraq.uk> <103392c$lpbg$5@dont-email.me>
	<1033o4a$1qj6$3@dont-email.me> <1033tv1$3aqu$3@dont-email.me>
	<1034pj8$a74s$1@dont-email.me> <mbmm2nFdsgcU2@mid.individual.net>
	<slrn105cajs.4vj.spamtrap42@one.localnet>
	<slrn105g20l.3q8n7.candycanearter07@candydeb.host.invalid>
	<mbr3glF5ijfU3@mid.individual.net>
	<slrn105j5it.2nvl6.candycanearter07@candydeb.host.invalid>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net BtbRd1ZVLJXj/J0mR/VDxwLL2BNS59sdEaJSjEZiRji4yONRtC
Cancel-Lock: sha1:B1cb7qpgkXEzfaQ6Y7fuIm0VfpA= sha256:r7b2kkISw8PLfntAvCmwAc0EkazRe6vPw6Gp3nfb8Tk=
User-Agent: Pan/0.160 (Toresk; )

On Mon, 23 Jun 2025 18:10:02 -0000 (UTC), candycanearter07 wrote:

>> calloc() is to be preferred imnsho. In many cases you're going to
>> memset()
>> the malloc'd memory to 0 so you might as well get it over with.
> 
> 
> Fair, but some might find it redundant to set the memory to 0 and
> immidietly write data over those null bytes.

It depends on what you plan to do with the memory. Typically you wouldn't 
memset() calloc'd memory. It comes in handy when you're going to copy in 
data that you want to use as a string without worrying about adding a 
NUL.