]> git.saurik.com Git - apple/xnu.git/blobdiff - libkern/OSKextVersion.c
xnu-7195.101.1.tar.gz
[apple/xnu.git] / libkern / OSKextVersion.c
index cbdef89e21bde45ad23d873c04bb64ae40a5a5da..35f361d88497dd53c130da55db215c9642cadc60 100644 (file)
@@ -169,9 +169,11 @@ __OSKextVersionStageForString(const char ** string_p)
 /*********************************************************************
 *********************************************************************/
 static const char *
-__OSKextVersionStringForStage(OSKextVersionStage stage)
+__OSKextVersionStringForStage(OSKextVersion stage)
 {
        switch (stage) {
+       default:
+               OS_FALLTHROUGH;
        case kOSKextVersionStageInvalid:     return NULL;
        case kOSKextVersionStageDevelopment: return "d";
        case kOSKextVersionStageAlpha:       return "a";
@@ -192,7 +194,7 @@ OSKextParseVersionString(const char * versionString)
        OSKextVersion   vers_major         = 0;
        OSKextVersion   vers_minor         = 0;
        OSKextVersion   vers_revision      = 0;
-       OSKextVersion   vers_stage         = 0;
+       OSKextVersionStage   vers_stage         = 0;
        OSKextVersion   vers_stage_level   = 0;
        const char    * current_char_p;
 
@@ -453,20 +455,20 @@ OSKextVersionGetString(
                return TRUE;
        }
 
-       cpos = snprintf(buffer, bufferLength, "%u", (uint32_t)vers_major);
+       cpos = scnprintf(buffer, bufferLength, "%u", (uint32_t)vers_major);
 
        /* Always include the minor version; it just looks weird without.
         */
        buffer[cpos] = '.';
        cpos++;
-       cpos += snprintf(buffer + cpos, bufferLength - cpos, "%u", (uint32_t)vers_minor);
+       cpos += scnprintf(buffer + cpos, bufferLength - cpos, "%u", (uint32_t)vers_minor);
 
        /* The revision is displayed only if nonzero.
         */
        if (vers_revision) {
                buffer[cpos] = '.';
                cpos++;
-               cpos += snprintf(buffer + cpos, bufferLength - cpos, "%u",
+               cpos += scnprintf(buffer + cpos, bufferLength - cpos, "%u",
                    (uint32_t)vers_revision);
        }