]> git.tdb.fi Git - libs/core.git/blobdiff - source/fs/windows/stat.cpp
Improve robustness of resolving user/group names in Stat
[libs/core.git] / source / fs / windows / stat.cpp
index ac9e0c977ac537fcd97bb9230b794ba7f334cc8a..36f28a0de3413ba489fbfea524ed9cad9ee999b6 100644 (file)
@@ -50,20 +50,20 @@ Stat::Private::Private(const Private &other):
 
 Stat::Private::~Private()
 {
-       if(owner_id)
+       if(owner_id!=INVALID_UID)
                HeapFree(GetProcessHeap(), 0, owner_id);
-       if(group_id)
+       if(group_id!=INVALID_GID)
                HeapFree(GetProcessHeap(), 0, group_id);
 }
 
 void Stat::Private::fill_owner_info(Stat::OwnerInfo &result)
 {
-       if(owner_id)
+       if(owner_id!=INVALID_UID)
                result.owner = get_account_name(owner_id);
        else
                result.owner = "None";
 
-       if(group_id)
+       if(group_id!=INVALID_GID)
                result.group = get_account_name(group_id);
        else
                result.group = "None";