/* Determine name of a terminal.
- Copyright (C) 2010-2012 Free Software Foundation, Inc.
+ Copyright (C) 2010-2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
return err;
if (buflen < sizeof (largerbuf))
{
- size_t namelen = strlen (largerbuf);
+ size_t namelen = strlen (largerbuf) + 1;
if (namelen > buflen)
return ERANGE;
memcpy (buf, largerbuf, namelen);