From f47d9eba946f1a289affddc1ff31433e023da23a Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sat, 7 Mar 2009 16:32:11 +0000 Subject: [PATCH] * contrib/adduser-old.c, contrib/adduser.c: Do not use the target of snprintf in one of the format's parameters. --- ChangeLog | 5 +++++ contrib/adduser-old.c | 2 +- contrib/adduser.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 266fa29a..566937ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-07 Nicolas François + + * contrib/adduser-old.c, contrib/adduser.c: Do not use the target + of snprintf in one of the format's parameters. + 2009-03-07 Nicolas François * man/groupmems.8.xml: groupmems does not create new user. diff --git a/contrib/adduser-old.c b/contrib/adduser-old.c index f924b36e..0b2080ec 100644 --- a/contrib/adduser-old.c +++ b/contrib/adduser-old.c @@ -230,7 +230,7 @@ void main() fflush(stdin); } else if (dir[strlen(dir)-1]=='/') - sprintf(dir,"%s%s",dir,uname); + sprintf(dir+strlen(dir),"%s",uname); printf("\nShell [%s]: ",DEFAULT_SHELL); fflush(stdout); diff --git a/contrib/adduser.c b/contrib/adduser.c index 72ed94b7..88596b02 100644 --- a/contrib/adduser.c +++ b/contrib/adduser.c @@ -296,7 +296,7 @@ main (void) sprintf (dir, "%s/%s", DEFAULT_HOME, usrname); } else if (dir[strlen (dir) - 1] == '/') - sprintf (dir, "%s%s", dir, usrname); + sprintf (dir+strlen(dir), "%s", usrname); } else { -- 2.40.0