VirtualBox

Changeset 49892 in vbox for trunk/src


Ignore:
Timestamp:
Dec 13, 2013 12:34:26 AM (11 years ago)
Author:
vboxsync
Message:

avoid the strcmp dependency here.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/hardenedmain.cpp

    r44529 r49892  
    55
    66/*
    7  * Copyright (C) 2008-2010 Oracle Corporation
     7 * Copyright (C) 2008-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #include <string.h>
    1918#include <VBox/sup.h>
     19
     20
     21/**
     22 * No CRT on windows, so cook our own strcmp.
     23 *
     24 * @returns See man strcmp.
     25 * @param   psz1                The first string.
     26 * @param   psz2                The second string.
     27 */
     28static int MyStrCmp(const char *psz1, const char *psz2)
     29{
     30    for (;;)
     31    {
     32        char ch1 = *psz1++;
     33        char ch2 = *psz2++;
     34        if (ch1 != ch2)
     35            return ch1 < ch2 ? -1 : 1;
     36        if (!ch1)
     37            return 0;
     38    }
     39}
    2040
    2141
     
    3050         * options to start a VM in main.cpp and VBoxGlobal.cpp exactly,
    3151         * otherwise there will be weird error messages. */
    32         if (   !::strcmp(argv[i], "--startvm")
    33             || !::strcmp(argv[i], "-startvm"))
     52        if (   !MyStrCmp(argv[i], "--startvm")
     53            || !MyStrCmp(argv[i], "-startvm"))
    3454        {
    3555            fFlags &= ~SUPSECMAIN_FLAGS_DONT_OPEN_DEV;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette