Add default to policy prompt and fix harmless bug in edit_policy()

This commit is contained in:
Nicolas Williams
2011-07-19 00:41:23 -05:00
parent a1203a703d
commit f2bb83c088

View File

@@ -188,8 +188,7 @@ edit_policy (const char *prompt, char **policy, int *mask, int bit)
return 0;
buf[0] = '\0';
if (*policy)
strlcpy(buf, *policy, sizeof (buf));
strlcpy(buf, "default", sizeof (buf));
for (;;) {
if(get_response("Policy", buf, resp, sizeof(resp)) != 0)
return 1;
@@ -198,8 +197,6 @@ edit_policy (const char *prompt, char **policy, int *mask, int bit)
if (parse_policy (resp, policy, mask, bit) == 0)
break;
}
if (*policy)
strlcpy(buf, *policy, sizeof (buf));
return 0;
}