bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] rumpkernel dependencies


From: Samuel Thibault
Subject: Re: [PATCH] rumpkernel dependencies
Date: Sun, 29 Mar 2020 00:55:35 +0100
User-agent: NeoMutt/20170609 (1.8.3)

Hello,

Damien Zammit, le sam. 28 mars 2020 16:50:41 +1100, a ecrit:
> I am sending this primarily because I don't want to lose these patches.

Ok, I already have comments on them :)


+      /* Parse @master:/dev/hello */
+      master = strdup (name);
+      copy = strdup (name);
+      pos = strchr (copy, ':');
+      *pos = '\0';
+      sprintf(master, "%s", &copy[1]);

There is no need to make a copy, strdup the whole string and then use
sprintf. Better do something like:

pos = strchr(name, ':')
master = strndup(name+1, pos-(name+1));

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]