use the utility function.

This commit is contained in:
christos 2015-12-02 04:06:10 +00:00
parent b8bf2c7dc6
commit c94670c3be

View File

@ -33,7 +33,7 @@
__FBSDID("$FreeBSD: src/sbin/gpt/remove.c,v 1.10 2006/10/04 18:20:25 marcel Exp $");
#endif
#ifdef __RCSID
__RCSID("$NetBSD: type.c,v 1.10 2015/12/01 19:25:24 christos Exp $");
__RCSID("$NetBSD: type.c,v 1.11 2015/12/02 04:06:10 christos Exp $");
#endif
#include <sys/types.h>
@ -86,10 +86,8 @@ cmd_type(gpt_t gpt, int argc, char *argv[])
while ((ch = getopt(argc, argv, GPT_FIND "T:")) != -1) {
switch(ch) {
case 'T':
if (!gpt_uuid_is_nil(newtype))
return usage();
if (gpt_uuid_parse(optarg, newtype) != 0)
return usage();
if (gpt_uuid_get(gpt, &newtype) == -1)
return -1;
break;
default:
if (gpt_add_find(gpt, &find, ch) == -1)