Additional fixes for inconsistent quoting in snprint functions
authorStewart, Sean <Sean.Stewart@netapp.com>
Tue, 23 Apr 2013 21:23:19 +0000 (21:23 +0000)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Mon, 29 Apr 2013 20:42:44 +0000 (22:42 +0200)
This patch finishes the job from this commit: http://git.opensvc.com/gitweb.cgi?p=multipath-tools/.git;a=commitdiff;h=cef43b6f910f740c0e2d38761f58c5ebedfb7585;hp=41b85341ca514a50d18c592996a2ecb43a81fa90
All attributes printing strings from their snprint functions should now be quotes.

Signed-off-by: Sean Stewart <Sean.Stewart@netapp.com>
libmultipath/dict.c

index ed3dae3..a8c4ba9 100644 (file)
@@ -1883,11 +1883,11 @@ snprint_mp_failback (char * buff, int len, void * data)
        case  FAILBACK_UNDEF:
                break;
        case -FAILBACK_MANUAL:
-               return snprintf(buff, len, "manual");
+               return snprintf(buff, len, "\"manual\"");
        case -FAILBACK_IMMEDIATE:
-               return snprintf(buff, len, "immediate");
+               return snprintf(buff, len, "\"immediate\"");
        case -FAILBACK_FOLLOWOVER:
-               return snprintf(buff, len, "followover");
+               return snprintf(buff, len, "\"followover\"");
        default:
                return snprintf(buff, len, "%i", mpe->pgfailback);
        }
@@ -2078,9 +2078,9 @@ snprint_mp_user_friendly_names (char * buff, int len, void * data)
        if (mpe->user_friendly_names == USER_FRIENDLY_NAMES_UNDEF)
                return 0;
        else if (mpe->user_friendly_names == USER_FRIENDLY_NAMES_OFF)
-               return snprintf(buff, len, "no");
+               return snprintf(buff, len, "\"no\"");
        else
-               return snprintf(buff, len, "yes");
+               return snprintf(buff, len, "\"yes\"");
 }
 
 static int
@@ -2260,11 +2260,11 @@ snprint_hw_failback (char * buff, int len, void * data)
        case  FAILBACK_UNDEF:
                break;
        case -FAILBACK_MANUAL:
-               return snprintf(buff, len, "manual");
+               return snprintf(buff, len, "\"manual\"");
        case -FAILBACK_IMMEDIATE:
-               return snprintf(buff, len, "immediate");
+               return snprintf(buff, len, "\"immediate\"");
        case -FAILBACK_FOLLOWOVER:
-               return snprintf(buff, len, "followover");
+               return snprintf(buff, len, "\"followover\"");
        default:
                return snprintf(buff, len, "%i", hwe->pgfailback);
        }
@@ -2382,9 +2382,9 @@ snprint_hw_user_friendly_names (char * buff, int len, void * data)
        if (hwe->user_friendly_names == USER_FRIENDLY_NAMES_UNDEF)
                return 0;
        else if (hwe->user_friendly_names == USER_FRIENDLY_NAMES_OFF)
-               return snprintf(buff, len, "no");
+               return snprintf(buff, len, "\"no\"");
        else
-               return snprintf(buff, len, "yes");
+               return snprintf(buff, len, "\"yes\"");
 }
 
 static int
@@ -2393,9 +2393,9 @@ snprint_hw_retain_hwhandler_handler(char * buff, int len, void * data)
        struct hwentry * hwe = (struct hwentry *)data;
 
        if (hwe->retain_hwhandler == RETAIN_HWHANDLER_ON)
-               return snprintf(buff, len, "yes");
+               return snprintf(buff, len, "\"yes\"");
        else if (hwe->retain_hwhandler == RETAIN_HWHANDLER_OFF)
-               return snprintf(buff, len, "no");
+               return snprintf(buff, len, "\"no\"");
        else
                return 0;
 }
@@ -2406,9 +2406,9 @@ snprint_detect_prio(char * buff, int len, void * data)
        struct hwentry * hwe = (struct hwentry *)data;
 
        if (hwe->detect_prio == DETECT_PRIO_ON)
-               return snprintf(buff, len, "yes");
+               return snprintf(buff, len, "\"yes\"");
        else if (hwe->detect_prio == DETECT_PRIO_OFF)
-               return snprintf(buff, len, "no");
+               return snprintf(buff, len, "\"no\"");
        else
                return 0;
 }