[prev in list] [next in list] [prev in thread] [next in thread]
List: hurd-bug
Subject: Re: [PATCH] - libstore: Add prefix @ to device to pass master device
From: Samuel Thibault <samuel.thibault () gnu ! org>
Date: 2019-11-24 19:36:36
Message-ID: 20191124193636.jjwhcxg4janyvzno () function
[Download RAW message or body]
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic