Ignore:
Timestamp:
Apr 7, 2007, 10:20:40 PM (18 years ago)
Author:
イグトランス (egtra)
Message:

[207]参照型変数のNothing初期化に対応する修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/Classes/System/Environment.ab

    r173 r208  
    2121        Dim size = GetCurrentDirectory(0, 0)
    2222        Dim p = _System_malloc(SizeOf (TCHAR) * size) As PCTSTR
    23         GetCurrentDirectory(size, p)
    24         CurrentDirectory = p
    25         _System_free(p)
     23        Dim len = GetCurrentDirectory(size, p)
     24        If len < size Then
     25            CurrentDirectory = New String(p, size As Long)
     26            _System_free(p)
     27        End If
    2628    End Function
    2729
     
    7274            Dim size = GetSystemDirectory(0, 0)
    7375            Dim p = _System_malloc(SizeOf (TCHAR) * size)
    74             GetSystemDirectory(size, p)
    75             sysDir = p
     76            Dim len = GetSystemDirectory(size, p)
     77            sysDir = New String(p, len As Long)
    7678            _System_free(p)
    7779        End IF
     
    117119        Dim dst = _System_malloc(SizeOf (TCHAR) * size)
    118120        ExpandEnvironmentStrings(src, dst, size)
    119         ExpandEnvironmentVariables = dst
     121        ExpandEnvironmentVariables = New String(dst, size - 1)
    120122        _System_free(dst)
    121123    End Function
    122124
    123125    Static Sub FailFast(message As String)
    124         OutputDebugString(ToTCStr(message))
    125         ExitProcess(-1)
     126        FatalAppExit(0, ToTCStr(message))
    126127    End Sub
    127128
Note: See TracChangeset for help on using the changeset viewer.