summaryrefslogtreecommitdiffstats
path: root/sbin/gpt
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2006-07-07 02:44:23 +0000
committermarcel <marcel@FreeBSD.org>2006-07-07 02:44:23 +0000
commitc946bc9408d8e12dd45af144b9b90dbb79179f1b (patch)
tree1e671c90a72743347122886d6d1b448233e2faac /sbin/gpt
parentf18b69f883bd456e6d5da7482ed6c2233478425b (diff)
downloadFreeBSD-src-c946bc9408d8e12dd45af144b9b90dbb79179f1b.zip
FreeBSD-src-c946bc9408d8e12dd45af144b9b90dbb79179f1b.tar.gz
Fix cut-n-paste bug: compare argument s against known aliases,
not the global optarg. This bug goes unnoticed because optarg is so far always the actual argument for the formal argument s.
Diffstat (limited to 'sbin/gpt')
-rw-r--r--sbin/gpt/gpt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sbin/gpt/gpt.c b/sbin/gpt/gpt.c
index 38dc557..b45cfd1 100644
--- a/sbin/gpt/gpt.c
+++ b/sbin/gpt/gpt.c
@@ -269,42 +269,42 @@ parse_uuid(const char *s, uuid_t *uuid)
switch (*s) {
case 'e':
- if (strcmp(optarg, "efi") == 0) {
+ if (strcmp(s, "efi") == 0) {
uuid_t efi = GPT_ENT_TYPE_EFI;
*uuid = efi;
return (0);
}
break;
case 'h':
- if (strcmp(optarg, "hfs") == 0) {
+ if (strcmp(s, "hfs") == 0) {
uuid_t hfs = GPT_ENT_TYPE_APPLE_HFS;
*uuid = hfs;
return (0);
}
break;
case 'l':
- if (strcmp(optarg, "linux") == 0) {
+ if (strcmp(s, "linux") == 0) {
uuid_t lnx = GPT_ENT_TYPE_MS_BASIC_DATA;
*uuid = lnx;
return (0);
}
break;
case 's':
- if (strcmp(optarg, "swap") == 0) {
+ if (strcmp(s, "swap") == 0) {
uuid_t sw = GPT_ENT_TYPE_FREEBSD_SWAP;
*uuid = sw;
return (0);
}
break;
case 'u':
- if (strcmp(optarg, "ufs") == 0) {
+ if (strcmp(s, "ufs") == 0) {
uuid_t ufs = GPT_ENT_TYPE_FREEBSD_UFS;
*uuid = ufs;
return (0);
}
break;
case 'w':
- if (strcmp(optarg, "windows") == 0) {
+ if (strcmp(s, "windows") == 0) {
uuid_t win = GPT_ENT_TYPE_MS_BASIC_DATA;
*uuid = win;
return (0);
OpenPOWER on IntegriCloud