When I compile dcmtk, the compiler runs into a file named mkdictbi.cc in dcmdata folder. And there are couple lines such as:
#elif HAVE_GETLOGIN
static char*
getUserName(char* userString, int maxLen)
{
#if defined(_REENTRANT) && !defined(_WIN32) && !defined(__CYGWIN__)
// use getlogin_r instead of getlogin
return getlogin_r(userString, int maxLen)
#else
char* s;
s = getlogin(); // thread unsafe
if (s == NULL) s = "<no-utmp-entry>";
return strncpy(userString, s, maxLen);
#endif
}
I think the line
return getlogin_r(userString, int maxLen)
has two errors.
1. Miss a ; at the end of the line
2. getlogin_r returns int not char*
Anyone can give me any explanation on this?
I appreciate any kind of suggestions.
dcmtk code error causes compile error
Moderator: Moderator Team
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
Thank you for the report. A possible fix would look like the following:
Code: Select all
< return getlogin_r(userString, int maxLen)
---
> if (getlogin_r(userString, maxLen) != 0)
> strncpy(userString, "<no-utmp-entry>", maxLen);
> return userString;
Who is online
Users browsing this forum: No registered users and 0 guests