From a1f52127a1aa0752d1285860fda6f181ec421737 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 24 Jul 2011 14:00:23 -0700 Subject: [PATCH] add an invalid protection level to the enum --- appl/ftp/ftp/security.c | 4 ++-- appl/ftp/ftp/security.h | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/appl/ftp/ftp/security.c b/appl/ftp/ftp/security.c index fe2f02309..86c73a168 100644 --- a/appl/ftp/ftp/security.c +++ b/appl/ftp/ftp/security.c @@ -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; diff --git a/appl/ftp/ftp/security.h b/appl/ftp/ftp/security.h index 6567a6e45..553372e28 100644 --- a/appl/ftp/ftp/security.h +++ b/appl/ftp/ftp/security.h @@ -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 { -- 2.11.4.GIT