From 85febc57298503845d6505f72edb853bde4842e5 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sun, 6 Jan 2008 19:26:58 +0000 Subject: [PATCH] Avoid setting the password to a const empty string, but set the first char to \0. This avoids a warning. --- ChangeLog | 5 +++++ src/passwd.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8bbd2803..e6443b7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-01-06 Nicolas François + + * src/passwd.c: Avoid setting the password to a const empty + string, but set the first char to \0. This avoids a warning. + 2008-01-06 Nicolas François * libmisc/salt.c: Add prototype for l64a(), gensalt(), diff --git a/src/passwd.c b/src/passwd.c index 9c1c6841..a6b5643c 100644 --- a/src/passwd.c +++ b/src/passwd.c @@ -468,7 +468,7 @@ static char *update_crypt_pw (char *cp) #endif if (dflg) - cp = ""; /* XXX warning: const */ + *cp = '\0'; if (uflg && *cp == '!') { if (cp[1] == '\0') {