bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH] - libstore: Add prefix @ to device to pass master device


From: Samuel Thibault
Subject: Re: [PATCH] - libstore: Add prefix @ to device to pass master device
Date: Sun, 24 Nov 2019 20:36:36 +0100
User-agent: NeoMutt/20170609 (1.8.3)

Hello,

Damien Zammit, le dim. 24 nov. 2019 12:33:59 +1100, a ecrit:
> So for example, with this patch I can call:
> 
>       settrans /dev/wd0s2 /hurd/storeio -T typed 
> part:2:device:@/dev/rump:/dev/wd0

Any comment on the syntax, anybody?

>      {
> +      /* Parse @master:/dev/hello */
> +      master = strdup (name);
> +      copy = strdup (name);
> +      pos = strchr (copy, ':');
> +      *pos = '\0';

Instead of duplicating all the string and truncating it, you can strchr
inside name, and strndup that.

You also don't need to strdup for "rest", you can just use rest =
name+something.

Thanks!
Samuel



reply via email to

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