add an invalid protection level to the enum

This commit is contained in:
Love Hörnquist Åstrand
2011-07-24 14:00:23 -07:00
parent af4aea85ae
commit 16eabf8e4c
2 changed files with 7 additions and 6 deletions

View File

@@ -81,7 +81,7 @@ name_to_level(const char *name)
for(i = 0; i < sizeof(level_names) / sizeof(level_names[0]); i++)
if(!strncasecmp(level_names[i].name, name, strlen(name)))
return level_names[i].level;
return (enum protection_level)-1;
return prot_invalid;
}
#endif
@@ -683,7 +683,7 @@ set_command_prot(enum protection_level level)
ret = command("CCC");
if(ret != COMPLETE) {
printf("Failed to clear command channel.\n");
return -1;
return prot_invalid;
}
}
command_prot = level;

View File

@@ -37,10 +37,11 @@
#define __security_h__
enum protection_level {
prot_clear,
prot_safe,
prot_confidential,
prot_private
prot_invalid = -1,
prot_clear = 0,
prot_safe = 1,
prot_confidential = 2,
prot_private = 3
};
struct sec_client_mech {