Changeset 85262 in vbox
- Timestamp:
- Jul 12, 2020 12:11:47 AM (4 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r85121 r85262 1191 1191 uRevision |= 1; 1192 1192 1193 *aAPIRevision = uRevision;1193 *aAPIRevision = (LONG64)uRevision; 1194 1194 1195 1195 return S_OK; … … 1914 1914 return rc; 1915 1915 1916 Utf8Str strCreateFlags(aFlags); 1916 /** @todo r=bird: Would be goot to rewrite this parsing using offset into 1917 * aFlags and drop all the C pointers, strchr, misguided RTStrStr and 1918 * tedious copying of substrings. */ 1919 Utf8Str strCreateFlags(aFlags); /** @todo r=bird: WTF is the point of this copy? */ 1917 1920 Guid id; 1918 1921 bool fForceOverwrite = false; … … 1924 1927 { 1925 1928 Utf8Str strFlag; 1926 const char *pcszComma = RTStrStr(pcszNext, ",");1929 const char *pcszComma = strchr(pcszNext, ','); /*clueless version: RTStrStr(pcszNext, ","); */ 1927 1930 if (!pcszComma) 1928 1931 strFlag = pcszNext; 1929 1932 else 1930 strFlag = Utf8Str(pcszNext, pcszComma - pcszNext);1931 1932 const char *pcszEqual = RTStrStr(strFlag.c_str(), "=");1933 strFlag.assign(pcszNext, (size_t)(pcszComma - pcszNext)); 1934 1935 const char *pcszEqual = strchr(strFlag.c_str(), '='); /* more cluelessness: RTStrStr(strFlag.c_str(), "="); */ 1933 1936 /* skip over everything which doesn't contain '=' */ 1934 1937 if (pcszEqual && pcszEqual != strFlag.c_str()) 1935 1938 { 1936 Utf8Str strKey(strFlag.c_str(), pcszEqual - strFlag.c_str());1939 Utf8Str strKey(strFlag.c_str(), (size_t)(pcszEqual - strFlag.c_str())); 1937 1940 Utf8Str strValue(strFlag.c_str() + (pcszEqual - strFlag.c_str() + 1)); 1938 1941 … … 1946 1949 1947 1950 if (!pcszComma) 1948 pcszNext += strFlag.length(); 1951 pcszNext += strFlag.length(); /* you can just 'break' out here... */ 1949 1952 else 1950 1953 pcszNext += strFlag.length() + 1; 1951 1954 } 1952 1955 } 1956 1953 1957 /* Create UUID if none was specified. */ 1954 1958 if (id.isZero())
Note:
See TracChangeset
for help on using the changeset viewer.

