Commit 36f78f8e authored by Andrew Price's avatar Andrew Price
Browse files

Fix strncpy length in add_mesg

Fixes:

  talk{0}-* !w
  Writing in folder Foo.
  Message from andy
  *** buffer overflow detected ***: /home/andy/src/mw/src/client/mw
  terminated
parent 091d260a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -189,7 +189,9 @@ int add_msg(int folnum, struct user *user, int replyto)

	new->date=time(0);
	if (!remote) printf(_("Message from %s\n"), user->record.name);
	strncpy(new->from, user->record.name, 30);
	strncpy(new->from, user->record.name, NAMESIZE);
	new->from[NAMESIZE] = '\0';

	if (replyto==0)
	{
		char t[NAMESIZE+1];