[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ccrtp-devel] bug in ccrtp-1.3.1 src/source.cpp line 79
From: |
Arjan Knepper |
Subject: |
[Ccrtp-devel] bug in ccrtp-1.3.1 src/source.cpp line 79 |
Date: |
Fri, 08 Jul 2005 12:20:37 +0200 |
User-agent: |
Mozilla Thunderbird 1.0.2 (Windows/20050317) |
#ifndef WIN32
70: static void
71: findusername(std::string &username)
72: {
73: // LOGNAME environment var has two advantages:
74: // 1) avoids problems of getlogin(3) and cuserid(3)
75: // 2) unlike getpwuid, takes into account user
76: // customization of the environment.
77: // Try both LOGNAME and USER env. var.
78: const char *user = Process::getEnv("LOGNAME");
79: // if ( !strcmp(user,"") )
---------------------^^^^ !
79: if ( ! user || !strcmp(user,"") )
80: user = Process::getEnv("USER");
81: if ( user )
82: username = user;
83: else
84: username = "";
85: }
------------------------
ln 79 'user' might be 0 and should therefore be checked before using it.
Thanks,
Arjan Knepper
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ccrtp-devel] bug in ccrtp-1.3.1 src/source.cpp line 79,
Arjan Knepper <=