9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] [patch] skelfs: remove useless code
@ 2022-11-11 17:17 Arne Meyer
  2022-11-11 17:37 ` Jacob Moody
  0 siblings, 1 reply; 5+ messages in thread
From: Arne Meyer @ 2022-11-11 17:17 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 162 bytes --]

Hello,
  
if I read the code correctly emalloc9p already checks for failed allocations and zeroes the memory, so the following code is redundant.

Greetings,
Arne

[-- Attachment #2: skelfs.patch --]
[-- Type: application/octet-stream, Size: 336 bytes --]

diff e5d29a2bd91951a24fccecd958416856cecef444 uncommitted
--- a/sys/src/cmd/skelfs.c
+++ b/sys/src/cmd/skelfs.c
@@ -101,9 +101,6 @@
 
 	s = old->aux;
 	s2 = emalloc9p(sizeof *s2);
-	if(s2 == nil)
-		return "out of memory";
-	memset(s2, 0, sizeof *s2);
 
 	s2->mode = s->mode;
 	utfecpy(s2->name, &s2->name[sizeof s2->name-1], s->name);

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-12 10:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-11 17:17 [9front] [patch] skelfs: remove useless code Arne Meyer
2022-11-11 17:37 ` Jacob Moody
2022-11-11 17:52   ` Arne Meyer
2022-11-11 19:20     ` Jacob Moody
2022-11-12 10:20       ` Arne Meyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).