summaryrefslogtreecommitdiff
path: root/modules/pam_issue
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2005-04-29 11:59:56 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2005-04-29 11:59:56 +0000
commitdd2fcb2e8c9d714d6c35de631b959695855875a0 (patch)
treef376ab2ccc6c272f52fce8364dab1eb3174df36c /modules/pam_issue
parentb808b3cd81f4beab1985b1ad821e188c44582cbd (diff)
Relevant BUGIDs: none
Purpose of commit: bugfix Commit summary: --------------- Fix some compiler warnings
Diffstat (limited to 'modules/pam_issue')
-rw-r--r--modules/pam_issue/pam_issue.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/pam_issue/pam_issue.c b/modules/pam_issue/pam_issue.c
index ba2d2006..5b3c864b 100644
--- a/modules/pam_issue/pam_issue.c
+++ b/modules/pam_issue/pam_issue.c
@@ -219,8 +219,10 @@ static char *do_prompt(FILE *fd)
{
char domainname[256];
- getdomainname(domainname, sizeof(domainname));
- domainname[sizeof(domainname)-1] = '\0';
+ if (getdomainname(domainname, sizeof(domainname)) == -1)
+ domainname[0] = '\0';
+ else
+ domainname[sizeof(domainname)-1] = '\0';
snprintf (buf, 1024, "%s", domainname);
}
break;
@@ -244,7 +246,7 @@ static char *do_prompt(FILE *fd)
if (c == 'd')
snprintf (buf, 1024, "%s %s %d %d",
weekday[tm->tm_wday], month[tm->tm_mon],
- tm->tm_mday,
+ tm->tm_mday,
tm->tm_year + 1900);
else
snprintf (buf, 1024, "%02d:%02d:%02d",